On Wed, 2004-11-03 at 16:06, Jim wrote:
>  > How do I get the name of the current PERL script I am 
> > running?  The answer to this question may be very obvious but 
> > I can't seem to locate it in my books or other resources.
> > 
> > Thanks in advance,
> > 
> 
> # strip the path info to the script:
> (my $prog = $0) =~ s/^.*[\\\/]//;

or use File::Basename to get the path, filename, suffix into different
vars:

# copied from 
# http://search.cpan.org/~nwclark/perl-5.8.5/lib/File/Basename.pm

use File::Basename;
my ($name,$path,$suffix) = fileparse($fullname,@suffixlist);

--Christopher



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to