Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: subtractionn in an arrayby GrandFather (Saint) |
on Mar 21, 2012 at 21:04 UTC ( [id://960867]=note: print w/replies, xml ) | Need Help?? |
I strongly recommend you add use strict; to every script you write. Also you should always use the three parameter version of open and lexical file handles (a variable declared with my): open my $fileIn, '<', 'filename.txt' or die "Unable to open filename.txt: $!\n". There are lots of ways to solve your problem and some of them don't need an array at all. Consider:
Prints:
Use perldoc to look up chomp and defined if you aren't familiar with them.
True laziness is hard work
In Section
Seekers of Perl Wisdom
|
|