Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Why use strict is good, and barewords are bad

by Anonymous Monk
on Apr 22, 2005 at 10:04 UTC ( [id://450331]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why use strict is good, and barewords are bad
in thread Why use strict is good, and barewords are bad

Or maybe you have a module that imports an apr() sub into your namespace for calculating Annual Precentage Rates.
As long as subs (or new buildins) without arguments return a string with the same name as they have, all will be well. I mean, if oct were to be defined that oct() eq "oct", the OPs example would not have been a problem.
  • Comment on Re^3: Why use strict is good, and barewords are bad

Replies are listed 'Best First'.
Re: Why use strict is good, and barewords are bad
by benizi (Hermit) on Apr 22, 2005 at 21:24 UTC

    While I like the clever solution to the problem at hand (barewords), I'm much happier that Perl chose the DWIMery of using a default argument of $_, e.g.: perl -Mstrict -lwe 'print for map oct, qw/077 777 034/'

    (63, 511, 28) vs. ("oct", "oct", "oct")

Re^4: Why use strict is good, and barewords are bad
by hardburn (Abbot) on Apr 22, 2005 at 21:27 UTC

    And if we could get around those pesky laws of thermodynamics, we could have a perpetual motion machine.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found