in reply to uninitialized value in concatenation

you can't use a here document like that send_mail($email_400, <<EOF ); because there's a right bracket and semicolon introduced as part of the here document or the start here document marker. either result is undesirable. A here document start marker needs a semicolon directly after the here document name (EOF in this case) afaik. one possible way is
if($email_400) { my $email_content = <<EOF; To: $email_400 .. .. EOF send_mail($email_400,$email_content); }
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^2: uninitialized value in concatenation
by johngg (Canon) on Nov 16, 2010 at 23:50 UTC
    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

      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