Re: RFC 14 (v3) Modify open() to support FileObjects and
[email protected] (Jon Ericson) Fri, 11 Aug 2000 15:50:43 -0700
| Newsgroups | perl.perl6.language.io |
|---|---|
| Message-ID | <[email protected]> |
Nathan Wiger wrote: > 1) > The URL says that it's a http resource, so why do we have > > to tell open to use a http handler? > > a) Allows custom handlers: > > open myhttp "http://www.perl.com/"; Explicitly register custom handles: use myhttp; register open, 'http' => myhttp::new; # syntax lifted from RFC open "http://www.perl.com/"; Or create your own scheme: register open, 'myhttp' => myhttp::new; # syntax lifted from RFC open "myhttp://www.perl.com/"; > b) Handles stuff without requiring URI syntax: > > open dir "C:\Windows\System"; # the "C:" handler? Not unless there is a C handler registered. 'file' should be the fall back handler when the filename is not a URL. (Try typing 'C:\Windows\System' in the Netscape 'location' box the next time you're on a DOS-based machine.) open should be able to Do What I Mean in most cases. If not, you can always C<opendir 'C:/Windows/System'>. Jon -- Knowledge is that which remains when what is learned is forgotten. - Mr. King