<br><font size=2 face="sans-serif">The best way I've found to do this has
been FindBin. &nbsp;We often use it to find where the custom libs are relative
to the application, such as the following code:</font>
<br>
<br><font size=2 face="sans-serif">use FindBin;</font>
<br><font size=2 face="sans-serif">use lib &quot;$FindBin::Bin/../../libs/perl&quot;;</font>
<br>
<br><font size=2 face="sans-serif">or to obtain the location:</font>
<br>
<br><font size=2 face="sans-serif">use FindBin;</font>
<br><font size=2 face="sans-serif">my $appPath = $FindBin::Bin;</font>
<br>
<br><font size=2 face="sans-serif"><br>
---<br>
Rick Croote<br>
Software Engineer<br>
Environment and Tools Team<br>
Philips Medical Systems<br>
Bothell, WA<br>
Rick.Croote@Philips.com<br>
Phone: 425-487-7834<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=33%>
<br>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>Colin Meyer &lt;cmeyer@helvella.org&gt;</b>
</font>
<p><font size=1 face="sans-serif">Sent by:</font>
<br><font size=1 face="sans-serif">spug-list-bounces+rick.croote=philips.com@pm.org</font>
<p><font size=1 face="sans-serif">2006-05-30 04:21 PM</font>
<td width=66%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">jlb &lt;jlb@io.com&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">spug-list@pm.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: SPUG: finding full path to itself</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Classification</font></div>
<td></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<div align=right>
<br></div></table>
<br>
<br>
<br><font size=2><tt>On Tue, May 30, 2006 at 05:40:05PM -0500, jlb wrote:<br>
&gt; Cwd.pm provides some portable, safe methods to determine your current
<br>
&gt; working directory.<br>
<br>
Or see FindBin.pm, if you want to know where the script itself is<br>
located (e.g. to be able to read a config file from the same dir).<br>
<br>
-Colin.<br>
<br>
&gt; <br>
&gt; On Tue, 30 May 2006, Satish Gupta wrote:<br>
&gt; <br>
&gt; &gt; When I a stand-alone script is running, how can this script determine
it's own absolute path in a portable manner?<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;I notice that $0 works differently on different OS's. On
some it gives full path and not on others.<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;Thanks<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ---------------------------------<br>
&gt; &gt; Be a chatter box. Enjoy free PC-to-PC calls &nbsp;with Yahoo!
Messenger with Voice.<br>
&gt; _____________________________________________________________<br>
&gt; Seattle Perl Users Group Mailing List &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp;POST TO: spug-list@pm.org<br>
&gt; SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list<br>
&gt; &nbsp; &nbsp; MEETINGS: 3rd Tuesdays<br>
&gt; &nbsp; &nbsp; WEB PAGE: http://seattleperl.org/<br>
_____________________________________________________________<br>
Seattle Perl Users Group Mailing List &nbsp;<br>
 &nbsp; &nbsp; POST TO: spug-list@pm.org<br>
SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list<br>
 &nbsp; &nbsp;MEETINGS: 3rd Tuesdays<br>
 &nbsp; &nbsp;WEB PAGE: http://seattleperl.org/<br>
</tt></font>
<br>