Are you learning Perl, or are you seeking a fully written script? If it's the former, please specify what part of the problem you are stuck on. We're glad to help with specific stumbling blocks. But if it's the latter, and you are just requesting that someone write the script for you, you're at the wrong place, and might have better luck at a for-pay site such as http://answers.google.com, or by hiring someone at http://jobs.perl.org.
To learn how to accomplish the task you're discussing, I would recommend picking up a copy of the Llama book, from O'Reilly & Associates, Learning Perl, by Randal Schwartz. Just about everything you're asking is addressed in that book, and it will take you only a few days to get through it. If you're intent on learning Perl, that's a minimal investment of time, but worthwhile, and practically a requirement before you can get to a point where you find yourself actually learning Perl rather than staring blankly at scripts others have written. You will also find a lot of good information in the Plain Old Documentation (POD) that comes with Perl:
- perlintro - Introduction to programming Perl.
- perlopentut - Introduction / tutorial for opening files.
- split - This is where you can learn how to split a line up based on tab delimiters among others.
- perlrequick - An introduction to Regular Expressions... also helpful when learning how to use split
- push - This is where you can learn how to push elements onto an array.
- open - More detail on opening files.
- perlop - Pay attention here to the diamond operator <FILEHANDLE>. You can use that to read from files.
I hope that's enough to get you started. Let us know when you run into something for which you need further clarification.
| [reply] [d/l] |
And just to get you started look at the following commands/syntax..
my @array = ();
for $file ( qw(file1 file2 file3) ){
open(IN,'<',$file)
while(IN){
chomp;
split;
}
close (IN)
}
Use these to make some script, and when you have something we'll comment on it to help you make it better/function ;-)
| [reply] [d/l] |