See perlsyn about Foreach-Loops. Basically, $_ acts like an alias and the reading from a file overwrites it.
Also, you should learn to check the success of open and to emit error messages. Also, Data::Dumper::Dumper takes an array reference not an array.
In reply to Re: Array element getting deleted
by Corion
in thread Array element getting deleted
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |