Why doesn't this work: perl -e "@s=([1,2],[3,4]); print $s[0][0];"



(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?

Thanks in advance for your help.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland 21202
410-659-6139

.



Relevant Pages