Re: RFC 14 (v3) Modify open() to support FileObjects and
[email protected] (Jonathan Scott Duff) Mon, 14 Aug 2000 16:45:28 -0500
| Newsgroups | perl.perl6.language.io |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 14, 2000 at 04:50:51PM -0400, Casey R. Tweten wrote: > open HOME_PAGE, "> $url" or die $!; #assuming default (as of 5.6.x) syntax > print HOME_PAGE getprint $url; > close HOME_PAGE; > > So now we have a file called `http://my.homepage.com`. Perhaps we want to > parse this file, so now we have to open it up. > > open "http://my.homepage.com"; So ... Don't Do That. Besides under this proposal, if you want to force Perl to treat that thing like a file, you can: $fh = open file "http://my.homepage.com"; or less verbose, $fh = open "<http://my.homepage.com"; > While I'm facinated by the idea of open() being so robust, I think that > the discussion for syntax may need 1) a new list of it's own or 2) to wait > for a while, perhaps after a decision to support this is made. I think the decision has already been made. -Scott -- Jonathan Scott Duff [email protected]