Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Have you checked what file this fails on? Your readdir will return the entire contents of the directory, including '.' and '..', which will cause your open to fail. Try modifying
open(MYFILE,"C:/Perl/bin/Anti/$file") or die "Count open file :$!"; to open(MYFILE,"C:/Perl/bin/Anti/$file") or die "Count open file $file:$!"; and that will uncover your culprit. In a side note, you have a serious potential security issue by using the two-argument form of open in this context. If there is a maliciously named file in your directory of interest, this script can be made to run arbitrary code. In reply to Re: Unable to read files from a directory
by kennethk
|
|