in reply to Re^2: I usually debug via...
in thread I usually debug via...
For example, my "main" script might contain the following:
use strict; require 'gen_subs.pl'; my $foo = { 'abc', 123, 'def', 456 }; gs::do_dumper( 'foo423:', $foo ) # 423 a silly, easy-to-find label if 0;
and a helper file/libary named 'gen_subs.pl' might contain:
package gs; use strict; use Data::Dumper; sub do_dumper { my ( $label, $variable ) = @_; my $msg = Dumper( $variable ); warn "$label:\n$msg\n"; }
|
---|