This isn't really answering your question, but I feel
it is important to point out something that you're
doing.
open(FILE,"$_");
When you do
"$foo", it incurs a slight
performance hit. Simply
$foo on its
own is better. Also, apparently, if
$foo
happens to be a scalar reference, Perl will dereference
it if you don't put it in quotes, but won't otherwise.
I doubt you want to open a file named with the memory
address of the reference?
See the part of the Perl FAQ that says "What's wrong
with always quoting "$vars"?"