> -----Original Message-----
> From: the.noonings [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 26, 2004 7:25 PM
> To: Autrijus Tang; Murphy
> Cc: Par Maillist
> Subject: Re: $0 does not contain a full path to the script
> 
> 
> 
> Notes on obtaining $0 on Windows and Cygwin: $0 has trickery to it.
> 
> I am not sure of the real purpose of $0, but I have found it 
> to be unreliable in that what it yeilds depends too much on 
> how the script was invoked, and also on what OS it is running on.
> 
> For the purpose of discussion, assume there is the perl file 
> path.pl that creates the file dollar_zero.txt that holds 
> whatever $0 was when path.pl was running.  It is pasted further below.
> 
> On Windows XP Pro, if path.pl is called with "perl path.pl" 
> then $0 will contain "path\path.pl", where path starts with 
> whatever directory we were in at the time.  However, if it is 
> called with just "path\path.pl" relying on the windows perl 
> association, then $0 will contain the fully qualified path name.
> 
> Cygwin is different, too.  $0 in cygwin seems to be only the 
> relative path from the current directory.
> 
> I have not investigated what $0 yeilds on other OS machines, 
> but I would be wary of differences there, too.
> 

I think the Find::Bin module handles this problem in an OS independent way.
http://search.cpan.org/~nwclark/perl-5.8.4/lib/FindBin.pm#DESCRIPTION

May be a look in its code would help ...

Just a thought,

Jos�.


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.

Reply via email to