in reply to Re: uninitialized value in concatenation
in thread uninitialized value in concatenation

A here document start marker needs a semicolon directly after the here document name (EOF in this case) afaik.

No, other stuff can follow the marker if required. I often use this to inline data in a HEREDOC and open it as if it was a file.

knoppix@Microknoppix:~$ perl -Mstrict -we ' > open my $fh, q{<}, \ <<EOD or die qq{open: < HEREDOC: $!\n}; > line 1 > line 2 > line 3 > EOD > > while ( <$fh> ) > { > $_ = ucfirst; > print; > } > > close $fh or die $!;' Line 1 Line 2 Line 3 knoppix@Microknoppix:~$

I hope this is of interest.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: uninitialized value in concatenation
by aquarium (Curate) on Nov 17, 2010 at 00:42 UTC
    thanks JohnGG, that's interesting...i must be getting old now if i'm forgetting stuff from the manual...where's a lake so i can do fishing instead?
    r u really running on a knoppix?..on a mobile device?
    the hardest line to type correctly is: stty erase ^H
      perldoc perlop

      perldoc -q here.*?doc

      Found in perlfaq4   Why don't my <<HERE documents work?

      Short demo

      print <<interp, <<'nointerp', <<"inter\"\pol"; this is $] interp and this is $] nointerp and this is $], semicolon important diff quoting rules, you can only escape the " not demonstrated are backticks, they also interpolate inter"\pol print "the end\n" __END__ this is 5.010001 and this is $] and this is 5.010001, semicolon important diff quoting rules, you can only escape the " not demonstrated are backticks, they also interpolate the end