Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: strange form in sub parameters

by ikegami (Patriarch)
on Mar 31, 2015 at 21:17 UTC ( [id://1122060]=note: print w/replies, xml ) Need Help??


in reply to strange form in sub parameters

The * prototype forces the argument expression to be evaluated in scalar context. Furthermore, if the argument expression is an identifier but not an operator, the identifier will be passed as a string ("auto-quoted"). This allows one one to create subs with the same interface as open and read.

The $ prototype forces the argument expression to be evaluated in scalar context.

The semi-colon separates the required arguments (on the left) from the optional ones (on the right).

sysreadline($foo) Passes $foo sysreadline(FOO) Passes "FOO" sysreadline($foo, $bar) Passes $foo and $bar sysreadline(FOO, $bar) Passes "FOO" and $bar

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found