Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Any differences between method and method()?

by influx (Beadle)
on Aug 18, 2012 at 11:06 UTC ( #988196=note: print w/replies, xml ) Need Help??


in reply to Any differences between method and method()?

If you've predeclared the subroutine you can leave the '()' off. I generally use it anyway so any maintainers of my code KNOW its a subroutine without even thinking.
  • Comment on Re: Any differences between method and method()?

Replies are listed 'Best First'.
Re^2: Any differences between method and method()?
by dave_the_m (Prior) on Aug 18, 2012 at 11:20 UTC
    If you've predeclared the subroutine you can leave the '()' off.
    That's only relevant for function calls; for method calls, predeclaring makes no difference. And to the OP, there's no difference whether you have the () or not.

    Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988196]
help
Chatterbox?
[Discipulus]: i got also a parser error, but once
[KurtZ]: Code Tags
[KurtZ]: ?
[choroba]: <code>...</code>
[choroba]: Discipulus: Yes, all get calls should be wrapped in a Try::Tiny
[choroba]: you can just create a ticket :)
[Discipulus]: Ah! is i'll have some fre4e time i'll try try::tiny

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-07-24 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (349 votes). Check out past polls.