Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 examining the Monastery: (3)
As of 2014-10-25 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls