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]

Reply via email to