Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^2: Indented HEREDOC?

by reasonablekeith (Deacon)
on May 26, 2006 at 08:41 UTC ( #551797=note: print w/replies, xml ) Need Help??

in reply to Re: Indented HEREDOC?
in thread Indented HEREDOC?

sorry for the nit-pick, but given the OP's example showed a variable, the example really should have been.
if ($foo) { print <<" STRING"; foo is $foo. STRING }
With the difference being that I've used double quotes and not single quotes. I mention it becuase I missed this the first time I saw heredocs, and didn't realise it caused the entire contents of the heredoc to be either interpolated or not, dependant on whether you used double or single quotes, respectively.

The output of the above would obviously be

foo is whatever_is_in_foo

as opposed to single quotes, which would give

foo is $foo
my name's not Keith, and I'm not reasonable.

Replies are listed 'Best First'.
Re^3: Indented HEREDOC?
by Ovid (Cardinal) on May 26, 2006 at 23:27 UTC

    No need to apologize for the nitpick. It's a point well-taken.


    New address of my CGI Course.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2019-09-19 16:36 GMT
Find Nodes?
    Voting Booth?
    The room is dark, and your next move is ...

    Results (249 votes). Check out past polls.