#A PERL module with miscaleneous utility functions # #Released under the MIT License. (http://www.opensource.org/licenses/mit-license.php) #Permision to use, copy, modify, and create derivative works is granted. NO WARRANTY. # # #Arthur Kantor #6/24/05 Initial release package Util; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(&ecsystem loadDumper); use Carp; #error checking system call. dies if called program fails. sub ecsystem{ system($_[0]); confess("\nprogram failed with $?") if $?; return $?; } sub loadDumper{ open LETTOCODE, "<$_[0]" || die ("cannot open <$_[0]"); my $sep = $/; $/=undef; my $cmd=; # slurp $/ = $sep; close LETTOCODE; my $VAR1; eval($cmd); return $VAR1; }