Other ways to assign a filehandle to a variable?

2006-07-27 Thread Roman Daszczyszak
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

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dr.Ruud
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,

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread JupiterHost.Net
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

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dr.Ruud
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,

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread Dave Gray
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