John W. Krahn wrote:
Richard Lee wrote:
Thanks John for detailed explanation!!
I just dont' understand why \ (also didn't know that within [ ], \
has to be escaped.) needs to be watch out for within " " ..
\ use can be tricky, for example:
$ perl -le"print 'hello'"
hello
$ perl -le"print 'he\llo'"
he\llo
$ perl -le"print 'he\\llo'"
he\llo
$ perl -le"print 'hello\'"
Can't find string terminator "'" anywhere before EOF at -e line 1.
$ perl -le"print 'hello\\'"
Can't find string terminator "'" anywhere before EOF at -e line 1.
$ perl -le"print 'hello\\\'"
hello\
$ perl -le"print 'hel'lo'"
Bad name after lo' at -e line 1.
$ perl -le"print 'hel\'lo'"
hel'lo
And that is in a single quoted string where there is no interpolation.
Read the "Gory details of parsing quoted constructs" section of
perlop.pod:
perldoc perlop
John
this is tough reading for me.. but I will report back once I am done..
thanks!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/