in reply to Re: Multiple file input into a perl script
in thread Multiple file input into a perl script

This worked out great:
use File::DosGlob qw(bsd_glob); # to get sane whitespace semantics my $pattern = '/home/kelder/files/*.txt'; @ARGV = glob $pattern;
Only there is a new problem; my output file list reads like this:
Ai0.txt Ai1.txt Ai2.txt ... Ai10.txt Ai11.txt
What ends up happening is that in my "results" file, where I print my counts, the order of the inputs is messed up.
Output: File1 File10 File11 File2
How do I fix this ordering? Can I input the files in the order they are in the directory with another method? Thanks for all of the help so far!!

Replies are listed 'Best First'.
Re^3: Multiple file input into a perl script
by Corion (Patriarch) on Sep 30, 2008 at 19:58 UTC
      Sorting would be very useful, only I want to be able to sort the input files before I use their input- can I use the sort function on  @ARGV=glob $mypattern?

        What happened when you tried it?