On Wed, Aug 09, 2000 at 05:45:27PM +0100, Graham Barr wrote:
> > open '/usr/local/bin/'; # directory (note the trailing '/')
>
> Portability, not all platforms use /
But this one is. If this were a Mac
open ':usr:local:bin:'; # note the trailing :
would Do The Right Thing. Trailing directory separator means "open
this thing as a directory".
> My point is that many of these protocols are more complex than I would
> certain want open to handle. Leave the complex stuuf to those modules
> and use the API they provide.
Indeed, but Perl has to parse the fiename to find out what to do
anyway, it might as well figure out what module to load from the
"filename". Thus,
open "http://www.perl.com";
would load the "http" module and pass the "filename" as-is to its
"open" method. We could create a well-defined API to which modules
must conform in order to be used in this fashion. If the user wishes
to open a "file" with a protocol that doesn't have a module, it should
carp in a useful way (throw an exception, set a global $ERROR
variable, whatever).
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]
- Re: RFC 14 (v2) Modify open() to support ... Jonathan Scott Duff
- Re: RFC 14 (v2) Modify open() to supp... Chaim Frenkel
- Re: RFC 14 (v2) Modify open() to supp... Nick Ing-Simmons
- Re: RFC 14 (v2) Modify open() to support ... Piers Cawley
- Re: RFC 14 (v2) Modify open() to supp... Bart Lateur
- Re: RFC 14 (v2) Modify open() to support File... Tom Hughes
- Re: RFC 14 (v2) Modify open() to support ... Tom Hughes
- Re: RFC 14 (v2) Modify open() to supp... Chaim Frenkel
- Re: RFC 14 (v2) Modify open() to supp... Piers Cawley
- Re: RFC 14 (v2) Modify open() to support ... Piers Cawley
- Re: RFC 14 (v2) Modify open() to support File... Jonathan Scott Duff
- Re: RFC 14 (v2) Modify open() to support FileObje... Nathan Wiger
- Re: RFC 14 (v2) Modify open() to support File... Nathan Wiger
- Re: RFC 14 (v2) Modify open() to support File... Johan Vromans
- Re: RFC 14 (v2) Modify open() to support File... Nick Ing-Simmons
- Re: RFC 14 (v2) Modify open() to support FileObjects a... Graham Barr
- Re: RFC 14 (v2) Modify open() to support FileObje... Casey R. Tweten
- Re: RFC 14 (v2) Modify open() to support File... Nathan Wiger
