in reply to find the path of perl script

There's another perl module for that: FindBin.
use FindBin qw($Bin); print $Bin;
«A contentious debate is always associated with a lack of valid arguments.»

Replies are listed 'Best First'.
Re^2: find the path of perl script
by kalyanrajsista (Scribe) on Dec 18, 2009 at 10:43 UTC

    I would go with core module File::Basename

    use strict; use warnings; use File::Basename; my($filename, $directories, $suffix) = fileparse($0, qr/\.[^.]*/); print $filename,"\n";