I highly suggest getting copies of
Learning Perl,
Programming Perl, and
The Perl Cookbook.
To get you started, you can read files like this:
open FH, '<', $filename or die ("Can't open $filename");
#FH is a "filehandle", and the '<' means "open in read mode"
#('>' would be write)
while (<FH>) { #the angles around FH mean "read a line"
work_with_the_line($_);
# $_ holds the current line in this case
# work_with_the_line would be a subroutine defined by you
}
close FH;
#don't forget to close files!
Much perl code is out there "in the wild", I highly suggest searching to see if someone has solved a similar problem, then reading and learning from their source.
--
$me = rand($hacker{perl});