Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Embracing functions with parentheses

by eyepopslikeamosquito (Chancellor)
on Mar 16, 2005 at 10:31 UTC ( #439897=note: print w/ replies, xml ) Need Help??

in reply to Embracing functions with parentheses

For user-defined functions, I always use parens. This is being kind to the Perl parser, making it easier and less error-prone to switch between "use" (compile-time) and "require" (run-time). I've seen Perl newbies spend hours trying to figure out what is wrong because they didn't use parens when calling their user-defined functions. For example:

use strict; Fred; sub Fred { print "in function Fred\n" }
produces the error Bareword "Fred" not allowed while "strict subs" in use at line 2..

Re style guide, I quite like Abigail's My coding guidelines. If you know of any other good ones, please let me know, because I hope to (eventually) write a tutorial that will include recommendations on Perl style.

Comment on Re: Embracing functions with parentheses
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2015-11-27 07:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (719 votes), past polls