Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: Re: Re: where do you put your subs

by demerphq (Chancellor)
on Mar 08, 2002 at 13:59 UTC ( [id://150317]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: where do you put your subs
in thread where do you put your subs

my $paco = $foo->bar;
Is this a scalar or a call to a class method with no paramaters? Let's sift through the code to find out, oh joy!

It is and can _only_ be a method call. If it were anything (or rather the only other thing that I can think that you could mean) else it would be written as

my $snafu=$foo->{bar};
The placement of the subs at the top of a package does _not_ prevent you from using the parens style, whereas placing at the bottom _does_ prevent you from using the bareword style. Whereas the placment of subs has an indirect effect on error rates. Thus there is still no reason not to employ best practice.

Yves / DeMerphq
--
When to use Prototypes?
Advanced Sorting - GRT - Guttman Rosler Transform

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found