Ouch. No. Please, not:
@FileList = `ls -1`;
- The -1 isn't needed if the output is not a terminal.
- This fails on filenames that contain newlines
- This fails on non-Unix systems.
- This fails if ls is not what you think it is.
- This doesn't list the files that begin with dot, unless you're root.
- You didn't chomp the list, so the names still end in newline.
Much simpler:
@FileList = <*>;
Or, to get files that begin with dot:
@FileList = <.* *>;
-- Randal L. Schwartz, Perl hacker