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?
[marto]: yep :)
[Discipulus]: being her marto, can you explain what "Par for the course I'm afraid." means?
Discipulus here..
[marto]: "what is normal or expected in any given circumstances."
[marto]: better: "If a type of behaviour, event, or situation is par for the course, it is not good but it is normal or as you would expect"
[Discipulus]: thanks i was unable to decide where to split the sentece
[marto]: FWIW search.cpan rarely has issues, see http://noc.perl. org for a route to report problems
[oakbox]: thanks, marto.
[marto]: there was a period where search.cpan had some frequent outages for (IIRC) a couple of weeks. I've not had any problems since, until today.
[marto]: this was about 16 months ago maybe. the noc team are, in my experience, very responsive to reports of issues, so please raise the issue after checking known problems/outages

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-07-26 10:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (388 votes). Check out past polls.