Just another perl hacker somewhere near Disneyland
I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.
I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.
open( FH, "pwd|" ) or die "....: $!";
my $dir = <FH>;
chomp $dir;
It was awful, but it worked, at least until we migrated this code to a system where '/foo/bar' was a symbolic link to '/foo/blah/bar' (and there was logic that depended on stuff being in '/foo/bar'). pwd in
my $dir = $ENV{PWD};
And actually, the code is really just trying to recursively search directories, so I really ought to use File::Find...but that's more refactoring than I'm willing to do at this point
Cwd::chdir not useless after all 0 Comments More | Login | Reply /