[kw-pm] why is my $PWD uninitialized?
Ryan Fox
foxryan at gmail.com
Mon May 31 06:06:28 PDT 2010
Have a look at Cwd. http://perldoc.perl.org/Cwd.html
On Mon, May 31, 2010 at 9:02 AM, Robert P. J. Day <rpjday at crashcourse.ca>wrote:
>
> (aside: i'm suddenly immersed in a bunch of perl code so while my
> perl is very rusty, i'm going to be asking some admittedly dumb
> questions over the next little while as i get back to speed.)
>
> i'm rewriting a tutorial on the "udev" facility in linux, and it
> turns out that the source tarball has a "test" component that
> simulates plugging and unplugging various devices and checking the
> messages generated against what's expected. very cool.
>
> however, when i try to run the script on my ubuntu system:
>
> $ sudo test/udev-test.pl
> Use of uninitialized value $PWD in concatenation (.) or string at test/
> udev-test.pl line 1735.
>
> udev-test will run 142 tests:
>
> TEST 1: no rules
> device
> '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda'
> expecting node/link 'sda'
> Use of uninitialized value $PWD in concatenation (.) or string at test/
> udev-test.pl line 1663.
> Use of uninitialized value $PWD in concatenation (.) or string at test/
> udev-test.pl line 1663.
> add: error
> Can't exec "tree": No such file or directory at test/udev-test.pl line
> 1685.
>
> Use of uninitialized value $PWD in concatenation (.) or string at test/
> udev-test.pl line 1698.
> Use of uninitialized value $PWD in concatenation (.) or string at test/
> udev-test.pl line 1698.
> remove: ok
> ... etc etc ...
>
> the script udev-test.pl opens with:
>
> ...
> use warnings;
> use strict;
>
> my $PWD = $ENV{PWD};
> my $sysfs = "test/sys/";
> ...
>
> down at line 1735, there is:
>
> print CONF "udev_rules=\"$PWD\"\n";
>
> while at line 1663:
>
> if ((-e "$PWD/$udev_root$rules->{exp_name}") ||
> (-l "$PWD/$udev_root$rules->{exp_name}")) {
>
> i'm baffled -- shouldn't that variable be initialized? or am i just
> forgetting something hideously basic about my perl?
>
> rday
>
>
> --
>
> ========================================================================
> Robert P. J. Day Waterloo, Ontario, CANADA
>
> Linux Consulting, Training and Kernel Pedantry.
>
> Web page: http://crashcourse.ca
> Twitter: http://twitter.com/rpjday
> ========================================================================
> _______________________________________________
> kw-pm mailing list
> kw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/kw-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kw-pm/attachments/20100531/fbd38e5a/attachment.html>
More information about the kw-pm
mailing list