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

Re: passing return value of a function to print

by farang (Chaplain)
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 ...

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2016-10-27 06:37 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (353 votes). Check out past polls.