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

RE: [MacPerl-Toolbox] Determining a full path to the currentfolder



> -----Original Message-----
> From: owner-macperl-toolbox@macperl.org
> [mailto:owner-macperl-toolbox@macperl.org]On Behalf Of Chris Nandor
> Sent: Saturday, September 11, 1999 12:58 PM
> To: Henry Penninkilampi
> Cc: macperl-toolbox@macperl.org
> Subject: Re: [MacPerl-Toolbox] Determining a full path to the
> currentfolder
> 
> 
> At 2:42 +0930 1999.09.12, Henry Penninkilampi wrote:
> >I want to determine the full path to the folder in which a MacPerl
> >application resides, and has just been launched.
> 
> $ENV{MACPERL} gives exactly that.
> 

<snip>

> 
> If you were going to do this, I'd think a better way would be:
> 
>   use File::Basename;
>   $folderPath = dirname($appPath);

Sure, that works, but so does this...

# Remove the file name from the complete path
# Win32, MacOS & UNIX compliant
( $scriptPath = $0 ) =~ s{[^\\\/:]*$}{};

Just my 2 cents

Walter

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org