develooper Front page | perl.perl6.language.io | Postings from August 2000

Re: RFC 34 (v3) Angle brackets should not be used for file globbing

From:
Jon Ericson
Date:
August 31, 2000 13:19
Subject:
Re: RFC 34 (v3) Angle brackets should not be used for file globbing
Message ID:
39AEBD90.B458368C@jpl.nasa.gov
Tom Christiansen wrote:
> >=item Complex filehandle references
> 
> >    my %filesystem;
> >    my $filename = '/etc/shells';
> >    open $filesystem{$filename}, $filename
> >        or die "can't open $filename: $!";
> >    print <$filesystem{$filename}>;
> >    __END__
> 
> >    GLOB{0xa042284}
> 
> This goes hand-in-glove with the issue that you
> can't write:
> 
>     print $fh{$name} "data\n";
> 
> It's necessary but not sufficient to solve only the I part of this
> I/O difficulty.

Is some technical reason that this can't be done in perl 5?  I hate
having to add another pair of braces just to reassure perl that I didn't
forget a comma:

    print {$fh{$name}} "data\n";

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King



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