in reply to Re-2: Encoding wonders
in thread Encoding wonders
If EXPR is omitted, the scalar variable of the same name as the FILEHANDLE contains the filename.That means that if an open is called like open 0 then 0 is the filehandle, and the "scalar variable" to open. Take, for instance, this example from perlfunc::open:
If your asking why, as in why is it that way, I'd presume its for brevity and ease, as in:$ARTICLE = 100; open ARTICLE or die "Can't find article $ARTICLE: $!\n"; while (<ARTICLE>) {...
$LOG = '/path/to/log/file/'; open LOG;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re-6: Encoding wonders
by John M. Dlugosz (Monsignor) on Jun 15, 2001 at 05:27 UTC |