Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Perl Subroutines Call

by amir_e_a (Hermit)
on Jan 05, 2010 at 15:53 UTC ( #815782=note: print w/replies, xml ) Need Help??


in reply to Perl Subroutines Call

This one is the best option:

print Test('name 1','name 2');

Even better, with a space after a comma:

print Test('name 1', 'name 2');

The & is not needed. It's old-fashioned and may have side effects, which aren't too interesting.

The parentheses make the code more readable.

Damian Conway in "Perl Best Practices" suggests always using parentheses with subroutines and no parentheses with builtins such as print, unpack etc. If you don't have the book, you may see the relevant excerpt at its Amazon page.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-03-22 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?