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.
Liz | [reply] [d/l] |
| [reply] [d/l] |
$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 "dump.pm" 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.
Liz
| [reply] |