Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: use Ensure -- module to spot undefined stuff

by Fletch (Bishop)
on Aug 05, 2008 at 20:42 UTC ( [id://702487]=note: print w/replies, xml ) Need Help??


in reply to use Ensure -- module to spot undefined stuff

Erm, could you explain what this does that strict doesn't?

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re: use Ensure -- module to spot undefined stuff

Replies are listed 'Best First'.
Re^2: use Ensure -- module to spot undefined stuff
by gone2015 (Deacon) on Aug 06, 2008 at 07:59 UTC

    strict will throw out undefined/misspelt variables, but subroutines are left to be found at run-time (except for barewords).

    I agree that strict should do this, but it doesn't.

      Ah, so the question becomes what does this do that B::Lint doesn't do (other than being fatal rather than printing a warning, that is)?

      $ perl -MO=Lint -wce 'foo( );' Nonexistant subroutine 'foo' called at -e line 1 -e syntax OK

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        B::Lint only considers main (at least by default), which doesn't quite fit with an Object approach.

        As with use strict, I am surprised that there isn't something more built-in to cover the horribly common case of misspelling a subroutine name -- especially as the error can lie dormant in a little used part of one's code !

        If use strict covered it, or if B::Lint was easier to use and could be specified within packages, then this module would be redundant....

        In the meantime, I've found it useful and the reason for this posting is to see if other people would too.

Log In?
Username:
Password:

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

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

    No recent polls found