nysus has asked for the wisdom of the Perl Monks concerning the following question:
The first one places a filehandle directly into the contents of $fh while the second puts a reference to a filehandle into it. I'm with you there. But what's the practical difference between the two assignments? Is there ever a reason for using one over the other?my $fh = *STDOUT; and my $fh = \*STDOUT;
For example, the line below works with both cases above:
Similarly, the open function works just as well with either kind of indirect filehandle assignment. Thanks again, Monks. I'll make my donation in advance.print $fh "What the?";
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop";
$nysus = $PM . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Indirect filehandles
by dragonchild (Archbishop) on Jul 17, 2001 at 21:51 UTC | |
by nysus (Parson) on Jul 17, 2001 at 21:57 UTC | |
|
Re: Indirect filehandles
by petral (Curate) on Jul 17, 2001 at 23:20 UTC |