my $path=`pwd` on *nix
my $path=`cd` on win*

----- Original Message ----- 
From: "Brian Ling" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 4:25 AM
Subject: Path to script


> Hi all,
> 
> I have the following bit of code that works out the directory path to
> the currently executing script.
> 
> My $path = $0;
> $path =~ s#(^/.+/).+$#$1# ;
> 
> This works but doesn't make me happy, is there a better way? 
> 
> Thanks
> 
> Brian 
> 
> 
> 
> BBCi at http://www.bbc.co.uk/
> 
> This e-mail (and any attachments) is confidential and may contain 
> personal views which are not the views of the BBC unless specifically 
> stated.
> If you have received it in error, please delete it from your system, do 
> not use, copy or disclose the information in any way nor act in 
> reliance on it and notify the sender immediately. Please note that the 
> BBC monitors e-mails sent or received. Further communication will 
> signify your consent to this.
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to