Have a look at Cwd. <a href="http://perldoc.perl.org/Cwd.html">http://perldoc.perl.org/Cwd.html</a><br><br><div class="gmail_quote">On Mon, May 31, 2010 at 9:02 AM, Robert P. J. Day <span dir="ltr">&lt;<a href="mailto:rpjday@crashcourse.ca">rpjday@crashcourse.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
  (aside:  i&#39;m suddenly immersed in a bunch of perl code so while my<br>
perl is very rusty, i&#39;m going to be asking some admittedly dumb<br>
questions over the next little while as i get back to speed.)<br>
<br>
  i&#39;m rewriting a tutorial on the &quot;udev&quot; facility in linux, and it<br>
turns out that the source tarball has a &quot;test&quot; component that<br>
simulates plugging and unplugging various devices and checking the<br>
messages generated against what&#39;s expected.  very cool.<br>
<br>
  however, when i try to run the script on my ubuntu system:<br>
<br>
$ sudo test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a><br>
Use of uninitialized value $PWD in concatenation (.) or string at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line 1735.<br>
<br>
udev-test will run 142 tests:<br>
<br>
TEST 1: no rules<br>
device &#39;/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda&#39; expecting node/link &#39;sda&#39;<br>
Use of uninitialized value $PWD in concatenation (.) or string at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line 1663.<br>
Use of uninitialized value $PWD in concatenation (.) or string at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line 1663.<br>
add:         error<br>
Can&#39;t exec &quot;tree&quot;: No such file or directory at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line<br>
1685.<br>
<br>
Use of uninitialized value $PWD in concatenation (.) or string at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line 1698.<br>
Use of uninitialized value $PWD in concatenation (.) or string at test/<a href="http://udev-test.pl" target="_blank">udev-test.pl</a> line 1698.<br>
remove:      ok<br>
... etc etc ...<br>
<br>
  the script <a href="http://udev-test.pl" target="_blank">udev-test.pl</a> opens with:<br>
<br>
...<br>
use warnings;<br>
use strict;<br>
<br>
my $PWD                 = $ENV{PWD};<br>
my $sysfs               = &quot;test/sys/&quot;;<br>
...<br>
<br>
  down at line 1735, there is:<br>
<br>
print CONF &quot;udev_rules=\&quot;$PWD\&quot;\n&quot;;<br>
<br>
  while at line 1663:<br>
<br>
        if ((-e &quot;$PWD/$udev_root$rules-&gt;{exp_name}&quot;) ||<br>
            (-l &quot;$PWD/$udev_root$rules-&gt;{exp_name}&quot;)) {<br>
<br>
i&#39;m baffled -- shouldn&#39;t that variable be initialized?  or am i just<br>
forgetting something hideously basic about my perl?<br>
<br>
rday<br>
<br>
<br>
--<br>
<br>
========================================================================<br>
Robert P. J. Day                               Waterloo, Ontario, CANADA<br>
<br>
            Linux Consulting, Training and Kernel Pedantry.<br>
<br>
Web page:                                          <a href="http://crashcourse.ca" target="_blank">http://crashcourse.ca</a><br>
Twitter:                                       <a href="http://twitter.com/rpjday" target="_blank">http://twitter.com/rpjday</a><br>
========================================================================<br>
_______________________________________________<br>
kw-pm mailing list<br>
<a href="mailto:kw-pm@pm.org">kw-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/kw-pm" target="_blank">http://mail.pm.org/mailman/listinfo/kw-pm</a><br>
</blockquote></div><br>