in reply to RFC: Context tutorial
I was expecting more to be made of where contexts appear: particularly the fact that subroutine arguments are normally list context (you only mention this explicitly for print; the point could perhaps be generalised), and also -- without going into all the messy details of prototypes -- the fact that they sometimes unexpectedly aren't.
(I'm feeling particularly sensitive to that one because I was bitten by it the other day: took me a while to work out why
was always just stripping the first two characters from my string...)my @loc = ($offset, $length); my $part = substr $string, @loc;
On re-reading, I see you may be touching on this in your preamble, but there you refer only to "operators", which I initially took as excluding functions like substr(). So maybe all that's needed is a little clarification up top.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Context tutorial
by kyle (Abbot) on Jan 13, 2009 at 03:30 UTC |