Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Print statements inside a function call in a here-doc don't work

by CountZero (Bishop)
on Nov 12, 2012 at 22:28 UTC ( #1003515=note: print w/ replies, xml ) Need Help??


in reply to Print statements inside a function call in a here-doc don't work

As you see, a 0 is printed at the place of the subroutine call. That is of course the return 0 from your subroutine.

But the print in your subroutine happens before the print of the heredoc and hence it shows up --as expected-- before the heredoc. You are not printing into the heredoc, but directly to your standard output device!

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics


Comment on Re: Print statements inside a function call in a here-doc don't work
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-07-24 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls