Perl Monk, Perl Meditation | |
PerlMonks |
Re: Handling braces with methods without argumentsby Jenda (Abbot) |
on Sep 17, 2012 at 12:18 UTC ( [id://994027]=note: print w/replies, xml ) | Need Help?? |
Perl doesn't care, but in some well known languages the form without the braces would not call the method, but rather return a reference to the method (JavaScript and C# come to mind, not sure about Java ... though in C# it's a bit more complicated than that ...). Mainly to prevent confusion for people using those languages, I'd recommend using the second syntax. I don't see any reason to include the space within the braces. Jenda
In Section
Seekers of Perl Wisdom
|
|