in reply to Re: trouble with a simple script
in thread problem running executable in subdirectories
if "cd: 0:" means that it is attempting to cd into directory "0", then something must be wrong with the list, because the first scalar on that list should be 00112.
I'm guessing that error is from using split'',$foo;. It should be split ' ', $foo.
$ perl -E'say join ":", split "", "abc def"' a:b:c: :d:e:f $ perl -E'say join ":", split " ", "abc def"' abc:def
That said, if you're going to use ls,
can be simplified tomy $dirs = `ls -d *`; my @dirs = split ' ', $dirs;
chomp( my @dirs = `ls -d *` );
Update: hum, it's not really any simpler.
|
|---|