in reply to Improving the Error Handling of my Scripts

To avoid hard-coding any line numbers you can use the "caller" function:

http://perldoc.perl.org/functions/caller.html

Here's a simple example:
#!/usr/bin/perl exit main(); sub main { print_error("test1"); print_error("test2"); print_error("test3"); return 0; } sub print_error { my ($error) = @_; my $line = (caller(0))[2]; print "line " , $line , ": " , $error , "\n"; }

This will print:

-bash:perl$ perl caller.pl line 6: test1 line 7: test2 line 8: test3