Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Quick Dumper

by diotalevi (Canon)
on Dec 03, 2003 at 13:09 UTC ( #311887=note: print w/replies, xml ) Need Help??

in reply to Quick Dumper

Sure, as long as you don't call it a pragma. I'd expect some sort of scoping then and your code is all about being global.

Replies are listed 'Best First'.
Re: Re: Quick Dumper
by liz (Monsignor) on Dec 03, 2003 at 13:13 UTC
    Indeed. It's intended as a debugging tool. Ease of use is the only goal! Something that you would add as:
    perl -Mdump yourprogram
    and which would then allow you to call the "dump" method on your objects without any other changes to your program.


      What, just like that? I'm not sure how that would work since you'd have to have built in the ->dump method calls beforehand. Or do you include things like $obj->dump if $obj->can( 'dump' ) so it works in both cases?

        $obj->dump if $obj->can( 'dump' )

        Actually, I wouldn't do that, since you want the debug code removed from your source when running in production. So, by not loading "" while in production, your program would bomb because the "dump" method no longer exists, forcing you to either remove or disable the line.

        Now, if we would have real assertions, this would be different.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://311887]
[erix]: damn the fucking idiot can't even spell separation

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2018-06-20 20:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.