in reply to beginner help

for my $num ($first .. $last) { # do something with $num }

That for loop will iterate over the numbers in the range, $first to $last.

It sounds like you aren't using a book to learn from. I'd recommend Learning Perl.