in reply to Re: RFC: Context tutorial
in thread RFC: Context tutorial
Thanks for your comment. I guess I need to clarify that. The code you show does just what I would expect and also what I thought I described.
The array slice, @t[0,1], would be a list but for the scalar context. Because of the context, it evaluates to the last item in that list (i.e., $t[1]). This kind of behavior was the subject of Why does assignment change the result?, if you want to read about it more.
Before I post to Tutorials, I'll probably add your example to the others in that section to make this more obvious and probably also reword the line you quoted.
Thanks again for pointing this out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: Context tutorial
by gwadej (Chaplain) on Jan 13, 2009 at 21:24 UTC | |
by kyle (Abbot) on Jan 13, 2009 at 21:45 UTC | |
by ikegami (Patriarch) on Jan 14, 2009 at 01:46 UTC | |
by kyle (Abbot) on Jan 14, 2009 at 03:14 UTC |