Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: How do I get the full path to the script executing?

by clemburg (Curate)
on Nov 08, 2000 at 21:22 UTC ( [id://40563]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I get the full path to the script executing?
in thread 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://40563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-23 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found