Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Why must you use the array @files? This strikes me as a rather pointless constraint. What are you trying to do? Dealing with your attempt to read the files in your directory: as said by moritz, use glob. It's what it's made for. Your first step would look something like this: @files will now contain a blank-separated list of files which start with 08 or 09, followed by a hyphen and ending with '.txt'. You could then pass this to your ls -l command (the one in the backticks) and do the post-processing from your hash.pl routine. Alternatively, you could use opendir, readdir, and grep, resulting in something like this:
But it would be a really good idea to tell the Monks–many of whom actually like explaining the nuances of Perl if the question is couched appropriately–what your goal is. In reply to Re: Array problem......PLEASE HELP!
by swampyankee
|
|