Perfect canidate for Map.

On 4/26/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
Hello everyone,

I have a 'modify_variable' function that, well, modifies a variable.

I want to run it on several variables.

I have the following code that:
- builds an array of references on the variables,
- calls the function on the content of the reference,
- set the content of the reference to the result of the function.


# $var1, $var2 and $var3 are set previously

for     (       \$var1,
               \$var2,
               \$var3,
       )

{
       ${$_} = modify_variable ( ${$_} );
}

Questions:
- How do I improve my array definition?
- How to I call the modify_variable function in a more elegant way?

Thanks in advance.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/





--
Rodrick R. Brown
http://www.rodrickbrown.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to