Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Adding Global Keyword?

by Sec (Scribe)
on Feb 17, 2006 at 15:29 UTC ( #530970=note: print w/ replies, xml ) Need Help??


in reply to Re: Adding Global Keyword?
in thread Adding Global Keyword?

The question came from a friend, who wanted to use it just temporarily for debugging. He didn't want to import his "Debugging module" in every single package.
I know that in this case "Module::debug()" works. I looked into this problem out of sheer curiosity. It feels strangely unperlish to me that perl allows me to override existing builtin keywords, but not add my own.


Comment on Re^2: Adding Global Keyword?
Re^3: Adding Global Keyword?
by dragonchild (Archbishop) on Feb 17, 2006 at 15:33 UTC
    Look into if and conditional compilation using constants.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re^3: Adding Global Keyword?
by Anonymous Monk on Feb 18, 2006 at 11:17 UTC
    I'd cheat.
    sub what::s { ... debug code here... }
    Then later, anywhere...
    what's($foo); what's($bar);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-12-22 18:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (126 votes), past polls