From ec938d4da786f7fd545b2ca27ebd5ea5c8b45c84 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:45 +0000 Subject: r117: Initial Import --- Dh_Lib.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Dh_Lib.pm') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 00f28132..e7070326 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -131,12 +131,11 @@ sub error { my $message=shift; # Output a warning. sub warning { my $message=shift; - print STDERR basename().": $message\n"; + print STDERR basename($0).": $message\n"; } -# Returns the basename of the program. -sub basename { - my $fn=$0; +# Returns the basename of the argument passed to it. +sub basename { my $fn=shift; $fn=~s:.*/(.*?):$1:; return $fn; } @@ -241,7 +240,7 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se } # TODO: do this in perl, perhaps? - complex_doit("echo \"# Automatically added by ".basename().">> $outfile"); + complex_doit("echo \"# Automatically added by ".basename($0).">> $outfile"); complex_doit("sed \"$sed\" $infile >> $outfile"); complex_doit("echo '# End automatically added section' >> $outfile"); } -- cgit v1.2.3