Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Forward declaration of subs

by 2teez (Priest)
on Oct 11, 2013 at 23:30 UTC ( #1057961=note: print w/ replies, xml ) Need Help??


in reply to Forward declaration of subs

Hi perlaintdead,
With forward declaration of subroutine, you can omit the parentheses usage like thus:

use warnings; use strict; sub printer; printer 'hello','world','again'; # NOTE HERE sub printer{ print $_,$/ for @_; }
Without the forward declaration one would have to do
... printer(...); ...
#Update: ++BrowserUk faster fingers!!!

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Forward declaration of subs
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2014-04-18 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls