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

Re: Calling Functions

by Happy-the-monk (Abbot)
on Mar 28, 2012 at 08:37 UTC ( #962101=note: print w/replies, xml ) Need Help??

in reply to Calling Functions

A concise description is in perlsub:

A subroutine may be called using an explicit & prefix. The & is optional in modern Perl, as are parentheses if the subroutine has been predeclared. The & is not optional when just naming the subroutine, such as when it's used as an argument to defined() or undef(). Nor is it optional when you want to do an indirect subroutine call with a subroutine name or reference using the &$subref) or &{$subref}() constructs, although the $subref->() notation solves that problem. See perlref for more about all that.

Subroutines may be called recursively. If a subroutine is called using the & form, the argument list is optional, and if omitted, no @_ array is set up for the subroutine: the @_ array at the time of the call is visible to subroutine instead. This is an efficiency mechanism that new users may wish to avoid.

Cheers, Sören

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962101]
[marioroy]: LA my @music_times = qx(find \$HOME/Music/ Albums -type f -iname \'*.mp3\' -exec mp3info -p \"%S\\n\" {} \\;);
[marioroy]: Only 2 backslash \\n
[marioroy]: LA no space before Albums
[Lady_Aleena]: Good guh! I think I will use File::Find when working in perl. That is too many toothpicks.
[marioroy]: mp3info must be in the PATH
[marioroy]: LA ++
[Lady_Aleena]: marioroy, this is forcing me to learn perl modules to use instead.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-04-23 21:26 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.