Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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?
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2016-05-30 10:00 GMT
Find Nodes?
    Voting Booth?