[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Finding a script's full pathname



At 18:20 -0400 on 22/04/97, Chris Nandor wrote:


> At 16.18 97/4/22, Stephane Jose wrote:
> >How can I get a script to know about its own full pathname?
> >
> >In MacPerl, the variable $0 only returns the name of the script
> >and not its full pathname.
>
> When I save a file to the desktop, call it test.pl, and have it execute
> "print $0", I get:
>
> PowerPudge:Desktop Folder:test.pl
>
> That's the full pathname.  I'm using MacPerl 5.1.4a1, which should be
> indistinguishable from MacPerl 5.1.3 in this regard.
>
> #================================================================
> Chris Nandor                                      pudge@pobox.com
> PGP Key 1024/B76E72AD                           http://pudge.net/
> Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6


Er,

I just realized that I was running the script from an unsaved document
(Untitled window) hence 'print $0;' could only return the name of the
script.

Saving the script to the hard disk fixed my problem!!!

Duh!!!

Stˇphane (feeling real dumb :}

                ___S__t__e__p__h__a__n__e______J__o__s__e___

                        mailto:jose.stephane@uqam.ca
                       http://www.comm.uqam.ca/sjose/


                  Hiroshima 45, Tchernobyl 86, Windows 95



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch