in reply to run a perl script for all files in a folder
The most likely reason is that $ARGV[0] contains whitespace, but you haven't told us so.
If that really is the case, I recommend using File::Glob::bsd_glob which has far saner semantics than glob.
In Section
Seekers of Perl Wisdom