in reply to $_[0] as a filehandle
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:
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
This works.my $fh; open $fh, "<$myFile" or die "blah"; myFunc($fh); sub myFunc { my $fh = shift; while(<$fh>) { # do something } }
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: $_[0] as a filehandle
by sauoq (Abbot) on Oct 29, 2003 at 02:23 UTC | |
by batkins (Chaplain) on Oct 30, 2003 at 11:52 UTC | |
Re: Re: $_[0] as a filehandle
by pg (Canon) on Oct 29, 2003 at 02:36 UTC |
In Section
Seekers of Perl Wisdom