SPUG: finding full path to itself

Michael R. Wolf MichaelRWolf at att.net
Wed May 31 08:22:24 PDT 2006




use English;

Michael R. Wolf
    All mammals learn by playing!
        MichaelRWolf at att.net

> -----Original Message-----
> From: spug-list-bounces+michaelrwolf=att.net at pm.org [mailto:spug-list-
> bounces+michaelrwolf=att.net at pm.org] On Behalf Of Chris Wilkes
> Sent: Tuesday, May 30, 2006 9:13 PM
> To: spug-list at pm.org
> Subject: Re: SPUG: finding full path to itself
> On Tue, May 30, 2006 at 02:36:20PM -0700, Satish Gupta wrote:
> > When I a stand-alone script is running, how can this script determine
> > it's own absolute path in a portable manner?
> >
> > I notice that $0 works differently on different OS's. On some it gives
> > full path and not on others.
> Along those same lines how can I, in a portable manner, determine the
> full path to the perl executable?
> Kwiki has a hardcoded path of #!/usr/bin/perl which is okay for most
> non-windows machines, but I'm stuck with a windows box for right now.  It
> is not a big deal as I just edit index.cgi after every update (or I
> could edit the Kwiki::Files file) but it would be nice to automagically
> figure that out when installing Kwiki.
> Chris
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
>      POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>     MEETINGS: 3rd Tuesdays
>     WEB PAGE: http://seattleperl.org/

More information about the spug-list mailing list