in reply to Re^2: assign a string using multiline format
in thread assign a string using multiline format

why will punkish' HEREDOC interpolate while heith's won't? I don't see the difference ...?
  • Comment on Re^3: assign a string using multiline format

Replies are listed 'Best First'.
Re^4: assign a string using multiline format
by Taulmarill (Deacon) on Aug 26, 2005 at 13:28 UTC
    heredocs are interpolerated the same way, as the termination string is, so <<EOF is the same as <<"EOF", but <<'EOF' won't be interpolerated.
    read perldoc perlop -> Regexp Quote-Like Operators -> <<EOF
Re^4: assign a string using multiline format
by chibiryuu (Beadle) on Aug 26, 2005 at 14:54 UTC
    my $foo = 'bar'; print <<END; 1. \$foo is $foo END print <<"END"; 2. \$foo is $foo END print <<'END'; 3. \$foo is $foo END print <<`END`; echo 4. \$foo is $foo END
    results in
    1. $foo is bar 2. $foo is bar 3. \$foo is $foo 4. $foo is bar
    See perlop#Quote-and-Quote-like-Operators.