in reply to short dir listing

The backticks are interpolating your string a second time, see the example here:
my $cmd = "echo \\t\\t"; print "$cmd\n"; ### prints: echo \t\t print `$cmd`; ### prints: tt
So either double the number of backslashes, use quotemeta on the string before you send it to the backticks, or change the first line of my example to use single quotes.

Update: On second thought, maybe that's not what's happening. On my system, the backslashes were being interpolated the second time by the shell, not the backticks.. At least I think so ;) You're using windows, so I'm not sure what is happening.

blokhead

Replies are listed 'Best First'.
Re: Re: short dir listing
by P0w3rK!d (Pilgrim) on Oct 23, 2002 at 17:59 UTC
    $cmd = quotemeta($cmd); RESULT: cmd = dir\ \/b\ L\:\\Dir\\To\\Scan\\\*\.bat Parameter format not correct - "b\".

      Either use forward slashes in the dir name instead of backslashes or escape the backslashes in your dir name.

      $dir = 'L:/Dir/To/Scan'; # or $dir = "L:\\Dir\\To\\Scan";

      «Rich36»