in reply to Re^3: ternary conditional help
in thread ternary conditional help
This is because the entire expression is evaluated before being passed as arguments to print. print doesn't get called iteratively for each argument. It gets its arguments, and then iterates.
So that means $a = 2 is evaluated, then ' ', then $a = 3, and then the values of $a, ' ', and $a are passed to print. By the time the expression has been evaluated, $a contains 3 no matter how many times it appears in @_.
Dave
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: ternary conditional help (alias)
by tye (Sage) on Nov 28, 2016 at 21:39 UTC | |
Re^5: ternary conditional help
by ikegami (Patriarch) on Nov 29, 2016 at 20:45 UTC |
In Section
Seekers of Perl Wisdom