Re: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- From: paul@xxxxxxxx (Paul Johnson)
- Date: Fri, 31 Oct 2008 18:41:46 +0100
On Fri, Oct 31, 2008 at 01:34:05PM -0400, Zembower, Kevin wrote:
(This should probably be an easy one for someone.}
Why doesn't this work:
kevinz@centernet:/usr/local/src/rrd$ perl -e "@s=(["a","b"],["c","d"]);print $s[0][0];"
syntax error at -e line 1, near "]["
Execution of -e aborted due to compilation errors.
kevinz@centernet:/usr/local/src/rrd$ perl -e "@s=([1,2],[3,4]); print $s[0][0];"
syntax error at -e line 1, near "]["
Execution of -e aborted due to compilation errors.
kevinz@centernet:/usr/local/src/rrd$
I'm expecting either an 'a' or a '1'.
This is almost a character-by-character copy of the top example on page 269
of the Camel book. What am I overlooking?
Tryx using single quotes around the commandline script.
--
Paul Johnson - paul@xxxxxxxx
http://www.pjcj.net
.
- Follow-Ups:
- RE: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- From: "Zembower, Kevin"
- RE: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- References:
- Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- From: Kevin Zembower
- Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- Prev by Date: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- Next by Date: RE: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- Previous by thread: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- Next by thread: RE: Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"
- Index(es):
Relevant Pages
|