> "Pierre" == Pierre Mariani <[EMAIL PROTECTED]> writes:
Pierre> I want to run it on several variables.
Pierre> I have the following code that:
Pierre> - builds an array of references on the variables,
Pierre> - calls the function on the content of the reference,
Pierre> - set the content of
On Fri, 2007-04-27 at 14:26 -0400, Matthew J. Avitable wrote:
> Pierre,
> >> Thank you, but I got it to work the way I wanted, thanks to Matthew and
> >> Rob's posts:
> >>
> >> map { modify_variable(${$_}) } = \($var1, $var2, $var3);
> >>
>
> To annotate to what Paul said - the above won't wo
Pierre,
Thank you, but I got it to work the way I wanted, thanks to Matthew and
Rob's posts:
map { modify_variable(${$_}) } = \($var1, $var2, $var3);
To annotate to what Paul said - the above won't work. The block syntax
of map is "map BLOCK LIST". Plus, it looks like you are going to
On Fri, Apr 27, 2007 at 09:54:37AM -0700, Pierre Mariani wrote:
> Thank you, but I got it to work the way I wanted, thanks to Matthew and
> Rob's posts:
>
> map { modify_variable(${$_}) } = \($var1, $var2, $var3);
I think you'll find that syntax is incorrect.
And map in void context is generall
On Fri, 2007-04-27 at 12:45 -0400, Chas Owens wrote:
> On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
> > On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote:
> > > On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
> > > snip
> > > > > - modify_variable() doesn't appear to modify anythin
On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote:
> On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
> snip
> > > - modify_variable() doesn't appear to modify anything, otherwise why
> > > are you assigning its return value to the scal
On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote:
> On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
> snip
> > > - modify_variable() doesn't appear to modify anything, otherwise why
> > > are you assigning its return value to the scalar passed as a parameter?
> > > It seems to be just a fu
On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote:
snip
> - modify_variable() doesn't appear to modify anything, otherwise why
> are you assigning its return value to the scalar passed as a parameter?
> It seems to be just a function.
Modify_variable modifies its input variable.
I think the
Pierre Mariani wrote:
> Matthew and Rob, thank you for your replies.
>
>> - It's unclear whether you have a fixed set of variables to process.
>> Is the list always the same?
>
> Yes, the list is always the same.
>
>> - Why are you using references? Are you sure you need to?
>>
>> - modify_vari
Matthew and Rob, thank you for your replies.
> - It's unclear whether you have a fixed set of variables to process.
> Is
> the list always the same?
Yes, the list is always the same.
> - Why are you using references? Are you sure you need to?
>
> - modify_variable() doesn't appear to modify
Pierre Mariani 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 co
Hi Pierre,
my @tmp = ( $var1, $var2, $var3 );
@tmp = map modify_variable, @tmp;
which is better
Conway (in Perl Best Practices) prefers the block form of map, since in
his opinion, it's more readable. So you could rewrite it as:
my @tmp = ( $var1, $var2, $var3 );
@tmp = map { modify_variab
On Thu, Apr 26, 2007 at 03:26:02PM -0700, Pierre Mariani wrote:
> anyone know how to create an array of references?
my @a = \($a, $b, $c);
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ht
> # $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_
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
15 matches
Mail list logo