Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?
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 musing on the Monastery: (11)
As of 2016-09-29 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (555 votes). Check out past polls.