Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Better way to print text appended to a file "syntax problem"?

by JadeNB (Chaplain)
on Nov 23, 2009 at 16:38 UTC ( #808853=note: print w/replies, xml ) Need Help??


in reply to Better way to print text appended to a file "syntax problem"?

VinsWorldCom has already mentioned that you need to escape backslashes in a double-quoted string, but you may not realise that you are using a double-quoted string in your here-doc your here-doc is being treated as a double-quoted string. Specifically,
my $qqstring = <<"HERE"; This text is subject to double-quoted interpolation. It can include e +scapes like \t, and $variables. HERE my $string = <<HERE; This text is also subject to double-quoted interpolation. HERE my $qstring = <<'HERE'; This text is treated like a single-quoted string, except that it can c +ontain embedded single quotes. \t is just a backslash followed by a +'t', and $variables is just a dollar sign followed by the string 'var +iables'. HERE

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://808853]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-05-17 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (170 votes). Check out past polls.

    Notices?