Check the contents of your @array. I suspect it does not contain what you think it should:
use Data::Dumper; print Dumper(\@array);
You never print out the lines of your input file which match your conditions. I expect to see print $_; somewhere inside your while loop. The name of your $line variable is confusing to me. I would have expected it to be a line of your input file, but it is an element of your poorly-named @array.
In reply to Re: Problem in Foreach loop
by toolic
in thread Problem in Foreach loop
by cowboyrocks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |