Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Bachelor of Arts?by dws (Chancellor) |
on Aug 26, 2002 at 06:07 UTC ( [id://192775]=note: print w/replies, xml ) | Need Help?? |
More is revealed if you try
Indirectly, this goes toward explaining the behavior you're seeing. What's happening under the covers in is
So how does print "".$a, $a++ help explain this? Why doesn't it also print "BA"? That's because what gets passed as a first argument is a reference to an object that represents the evaluation of "".$a. At the time the expression was evaluated, $a still held 'A'. This behavior is hinted at in perlsub, which explains The array @_ is a local array, but its elements are aliases for the actual scalar parameters. In particular, if an element $_[0] is updated, the corresponding argument is updated
In Section
Seekers of Perl Wisdom
|
|