jey has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
This is Perl 5.004_04 for irix-n32
Does anyone know why $_[0] cannot be used as a filehandle?
In the example below myFunc doesn't work whereas myFonc does, do you know why?
#!/usr/bin/perl -w open FH, "<$myFile" or die "Can't open $myFile: $!\n"; &myFunc(\*FH); &myFonc(\*FH); sub myFunc { while (<$_[0]>) { #do something } } sub myFonc { my $handle = shift; while(<$handle>) { # do someything } }
thanks a lot
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $_[0] as a filehandle
by sauoq (Abbot) on Oct 29, 2003 at 02:07 UTC | |
by jey (Pilgrim) on Oct 29, 2003 at 02:18 UTC | |
|
Re: $_[0] as a filehandle
by dpuu (Chaplain) on Oct 29, 2003 at 02:49 UTC | |
|
Re: $_[0] as a filehandle
by Zaxo (Archbishop) on Oct 29, 2003 at 02:09 UTC | |
|
Re: $_[0] as a filehandle
by pg (Canon) on Oct 29, 2003 at 02:09 UTC | |
by jey (Pilgrim) on Oct 29, 2003 at 02:12 UTC | |
|
Re: $_[0] as a filehandle
by batkins (Chaplain) on Oct 29, 2003 at 02:11 UTC | |
by sauoq (Abbot) on Oct 29, 2003 at 02:23 UTC | |
by batkins (Chaplain) on Oct 30, 2003 at 11:52 UTC | |
by pg (Canon) on Oct 29, 2003 at 02:36 UTC |