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"><<a href="mailto:rpjday@crashcourse.ca">rpjday@crashcourse.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
(aside: i'm suddenly immersed in a bunch of perl code so while my<br>
perl is very rusty, i'm going to be asking some admittedly dumb<br>
questions over the next little while as i get back to speed.)<br>
<br>
i'm rewriting a tutorial on the "udev" facility in linux, and it<br>
turns out that the source tarball has a "test" component that<br>
simulates plugging and unplugging various devices and checking the<br>
messages generated against what'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 '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda' expecting node/link 'sda'<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't exec "tree": 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 = "test/sys/";<br>
...<br>
<br>
down at line 1735, there is:<br>
<br>
print CONF "udev_rules=\"$PWD\"\n";<br>
<br>
while at line 1663:<br>
<br>
if ((-e "$PWD/$udev_root$rules->{exp_name}") ||<br>
(-l "$PWD/$udev_root$rules->{exp_name}")) {<br>
<br>
i'm baffled -- shouldn'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>