develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #21672] IO::New and undefined filename behaviour

Thread Previous
From:
Rafael Garcia-Suarez
Date:
March 26, 2003 15:42
Subject:
Re: [perl #21672] IO::New and undefined filename behaviour
Message ID:
20030327004443.4279d449.rgarciasuarez@free.fr
mike@exegenix.com (via RT) wrote:
> A colleague wrote some code which was effectively did:
> 
>   use FileHandle;
>   my $var = undef;
>   my $fh = FileHandle->new($var, 'r') or die "...($!) \n";
> 
>   while (<$fh>) {
>     # ...
>   }
> 
> and was surprised that using undef or '' for a filename in the 2 arg form 
> of FileHandle->new didn't cause an error.

Thanks, I applied your fix to the current development version of perl
and will be available in perl 5.10 (and probably in perl 5.8.1)
(as change #19072).

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About