in reply to Re^10: chopping a string into slices - is there a more elegant way to do it?
in thread chopping a string into slices - is there a more elegant way to do it?
My recollection was that assignment determined it's context by the left-hand side of the operation.
That's impossible for two reasons.
Your code shows that the type of assignment is determined by its LHS, but noone's disputing that.
This seems to imply that the subroutine is evaluated in scalar context in the first assignment.
It is.
Scalar assignment evaluates both its LHS and RHS in scalar context.
List assignment evaluates both its LHS and RHS in list context.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: chopping a string into slices - is there a more elegant way to do it?
by gwadej (Chaplain) on Nov 30, 2008 at 22:46 UTC | |
by ikegami (Patriarch) on Dec 01, 2008 at 02:37 UTC | |
by gwadej (Chaplain) on Dec 01, 2008 at 02:42 UTC |