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

Re: two + 2 not equal 4!

by suhailck (Friar)
on Jul 24, 2010 at 06:15 UTC ( #851124=note: print w/ replies, xml ) Need Help??


in reply to two + 2 not equal 4!

To make the print statement work as you wrote, change the sub as given below,

perl -e 'sub two { $_[0] + 2 };print two + 2'

output:
4

~suhail


Comment on Re: two + 2 not equal 4!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-08-01 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (51 votes), past polls