There are a few reasons. First of all, you're using a reference to a glob as a filehandle - that's bound not to work. Also I'm not really sure what you're doing with split in myFonc; you might want to rethink that code. I would advise using lexically scoped filehandles. Something like this:
my $fh;
open $fh, "<$myFile" or die "blah";
myFunc($fh);
sub myFunc {
my $fh = shift;
while(<$fh>) {
# do something
}
}
This works.
The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.
- Frank Zappa