in reply to Re^4: If you believe in Lists in Scalar Context, Clap your Hands
in thread If you believe in Lists in Scalar Context, Clap your Hands
Bingo, @x is gets a one-element list -- or at least, it's a list in list context and a scalar in scalar context. Tricky! Here's a mind-bender. What's this?
It could be a three-element list, in list context, or it could be a scalar and two void expressions (which get optimized away), in scalar context. In void context, it could be nothing.
Update: Reworded one sentence.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: If you believe in Lists in Scalar Context, Clap your Hands
by jwkrahn (Abbot) on Oct 25, 2008 at 14:35 UTC | |
by chromatic (Archbishop) on Oct 25, 2008 at 18:41 UTC |