in reply to Re: calling .EXE through Perl script
in thread calling .EXE through Perl script
You should skip directories. At least '.' and '..' exist.
use strict; use warnings; $dir = "C:\\parser_pgm\\test"; opendir(TXT, $dir) or die "Can't open $dir: $!"; while( defined ($file = readdir TXT) ) { next if ! -f $file; # Skip if not a file `parser_pgm.exe $file`; } closedir(TXT);
Note also that I've changed the closedir(XML); to closedir(TXT); to match the opendir. The defined check is redundant by the way.
|
|---|