The stupid question is the question not asked | |
PerlMonks |
Re: eval order of args to a subby dewey (Pilgrim) |
on May 30, 2007 at 18:48 UTC ( [id://618264]=note: print w/replies, xml ) | Need Help?? |
From perlsub:
"...all functions are passed as parameters one single flat list of scalars, and all functions likewise return to their caller one single flat list of scalars."In other words, all subs have only one argument, a list value. Since the constructor for list values is the comma-separated list of values, the question becomes 'in what order are the arguments to the list-context comma operator evaluated?' Frustratingly, the documentation doesn't seem to say... My guess is that it's right to left in most implementations (due to the overloading of comma in scalar context) but that may not be dependable. Later: It is in fact defined as left to right! Thanks, ikegami. Later later: ummm, if this is crucial, please see discussion below. There is some disagreement. ~dewey
In Section
Seekers of Perl Wisdom
|
|