Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: passing return value of a function to print

by farang (Hermit)
on Jun 10, 2013 at 00:20 UTC ( #1037968=note: print w/ replies, xml ) Need Help??


in reply to passing return value of a function to print

Call the function properly and it works. Note parentheses.

use strict; use warnings; print func(); sub func { return "123"; }
Also I have added use strict; and use warnings; which is highly recommended and would have given you valuable feedback as to what the problem was.

Unquoted string "func" may clash with future reserved word ... print() on unopened filehandle func ...


Comment on Re: passing return value of a function to print
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (15)
As of 2014-07-30 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (235 votes), past polls