Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: User-Defined Sub, Passing a Single Argument?

by duelafn (Parson)
on Oct 15, 2014 at 17:33 UTC ( [id://1103940]=note: print w/replies, xml ) Need Help??


in reply to User-Defined Sub, Passing a Single Argument?

Method 2 should have parens: my ($arg) = @_;

As for which style to use, it really doesn't matter, it is all a matter of personal taste and I have used all three (though typically one of the first two).

Update: Better phrasing, thanks kennethk

Good Day,
    Dean

Replies are listed 'Best First'.
Re^2: User-Defined Sub, Passing a Single Argument?
by kennethk (Abbot) on Oct 15, 2014 at 17:37 UTC

    You may want to update your phrasing; the choice of method doesn't really matter, but your comment sounds like the parentheses don't matter. The missing parentheses are a bug.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-24 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found