Martin Evans [mailto:[EMAIL PROTECTED] wrote:
> 
> The first issue is the back slashes in the here document.
> 
> my $text = <<_EOF;
> hello\\\\
> _EOF
> print length($text), "\n";
> 
> prints 8 not 10 because \\ in a here document ends up as \. 
> So half of 
> your '\\\\' go straight away to '\\'.

You can use a single-quoted here-doc if you want literal backslashes:

my $text = <<'_EOF';
hello\\\\
_EOF
print length($text), "\n";

prints 10.

A single-quoted here-doc is the only way in Perl to turn off absolutely all
interpolation.

Ronald

Reply via email to