Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: non-barewords and use strict

by clintp (Curate)
on Sep 16, 2002 at 22:48 UTC ( #198389=note: print w/replies, xml ) Need Help??


in reply to non-barewords and use strict

Lemme re-comment this for you:
use strict; sub This::Does::Not::Fail { }; # Rightly so because you've already notified Perl that # this is a subroutine name. It *knows* this identifier # is a sub. Thanks for pre-declaring it! This::Does::Not::Fail; # rightly so # This fails because you've given perl no contextual hints # that this is a subroutine. It might be... a filehandle! # Or something else. But you haven't pre-declared it # either. This is a bareword (an identifier). This::Will::Fail; # as we expect # You haven't pre-declared this thing. # *BUT* you did give perl a contextual hint that this is # indeed a subroutine. This is essentially a *promise* # you've made to strict that at runtime, when this code is # encountered, you'll have a subroutine with this name # all ready to go. It::Bothers::Me::That::This::Works (); # wassup with THAT?!
For that last point, there are other "promises" you can make and not just with parens. Some of these include:
$obj->method; # Either $obj class' method will exist or # AUTOLOAD had better take care of it later. $a=foo Bar; # Bar will have a foo()! Or AUTOLOAD...etc. &foo; # Again, you've promised it will exist...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://198389]
help
Chatterbox?
[stevieb]: Just need to implement an email plugin or something so I can get alerted remotely if the status of a build has changed from the last run
[stevieb]: Because of the extreme complexity of the testing code itself, I implemented extensive logging so I can troubleshoot much easier by setting a high debug level.
[stevieb]: if you're interested in the test/build backend, have a look at Test::BrewBuild.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-04-28 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (529 votes). Check out past polls.