After reading Randal's March 2000 LM column and learning that you can
assign a filehandle to a scalar by doing something like:
open(FILE, $filename) or die whatever;
$value = *FILE{IO};
I am wondering if there are other, perhaps better, ways of doing this?
FYI, I googled for assigning
Roman Daszczyszak schreef:
After reading Randal's March 2000 LM column and learning that you can
assign a filehandle to a scalar by doing something like:
open(FILE, $filename) or die whatever;
$value = *FILE{IO};
I am wondering if there are other, perhaps better, ways of doing this?
FYI,
Use lexical ones in the first place.
open my $fh, '', $filename or die open $filename, stopped ;
And if you're gogint to die you might as well say why :)
... or die open $filename failed: $! ;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
JupiterHost.Net schreef:
Use lexical ones in the first place.
open my $fh, '', $filename or die open $filename, stopped ;
And if you're gogint to die you might as well say why :)
... or die open $filename failed: $! ;
Yes, I meant:
open my $fh, '', $filename or die open $filename,
For posterity:
http://perl.plover.com/local.html#3_The_First_Class_Filehandle_Tr
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response