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.
In reply to Re^2: calling .EXE through Perl script
by GrandFather
in thread calling .EXE through Perl script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |