[ David Macfarlane writes: ]
> > I'm not really clear on this explanation. Do I change every single
> > "@" to "\@"?
>
> Not exactly. Perl 5 only expands the @ inside double quoted text
> strings. So you would change
>
> print << "EOF"
> me@here
> EOF
>
> but not
>
> print << EOF
> me@there
> EOF
>
> ... because the second one does not do double-quoted-string expansion.
> That's how I've interpreted this issue and it is working so far (it seems!).
Not quite. Page 72 of the Camel says "An unquoted identifier works like
double quotes" so the 2 examples above are identical. Try the following
script to see the (non-)differences:
$xyzzy="burp!";
print <<EOF;
"$xyzzy" said the wizard.
EOF
print <<"EOF";
"$xyzzy" said the wizard.
EOF
print <<'EOF';
"$xyzzy" said the wizard.
EOF
--
Dave Wolfe *Not a spokesman for Motorola* (512) 891-3246
Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598
References:
|
|