in reply to How do I get the full path to the script executing?
If you want only the directory part, use File::Basename, like this:
#!/usr/bin/perl -w use strict; use File::Spec::Functions qw(rel2abs); use File::Basename; print dirname(rel2abs($0));
Using a regex here is calling for trouble.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
reply
|
|---|