Zembower, Kevin wrote:
(This should probably be an easy one for someone.}
Why doesn't this work:
[EMAIL PROTECTED]:/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.
The shell interpolates your string before perl sees it:
$ echo "@s=(["a","b"],["c","d"]);print $s[0][0];"
@s=([a,b],[c,d]);print [0][0];
So use single quotes instead:
$ echo '@s=(["a","b"],["c","d"]);print $s[0][0];'
@s=(["a","b"],["c","d"]);print $s[0][0];
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/