Nathan Wiger wrote:
> In another email you asked:
> 
> > Why not extend C<open> to be able to take other things besides
> > strings of text?

This wasn't me.

> Registering a custom handler has this capability. For example:
> 
>    use handler 'myhttp' => MyCustomMod;   # upcoming syntax
>    open myhttp $packed_binary_data;
> 
> Otherwise, how could you tell what to do with it if you just said:
> 
>    open $packed_binary_data;

I'd prefer:

  open "myhttp:$packed_binary_data";

> Please understand one thing, I like the idea of being able to say:
> 
>    open "http://www.yahoo.com";
> 
> I think it's cool. However, what I'm driving for with the RFC is a
> stable, consistent interface, which is what I believe something as
> critical as open() needs. I think the RFC should reflect this. If we
> want to put true URI support in Perl, we can do that separately. Just
> remember, there's no way to tell these two apart:
> 
>    # File or directory?
>    open "file:///etc";
>    open "file:///etc/motd";

Pick one:

1)  Filenames that end with a '/' are directories and those that don't
are files.  (Both examples are files.)

2)  Filenames are tested to determine how they are to be opened.  (C<-f
'/etc'> is false on my system, but C<-d '/etc'> is true, therefore it is
a directory.  '/etc/motd' is a file on my system since -f returns true
and -d returns false.)

The single argument open using URLS is a stable, standard interface to
all sorts of files.  Quoting from <http://www.w3.org/Addressing/>:

Uniform Resource Identifiers (URIs, aka URLs) are short strings that
identify resources in the web: documents, images, downloadable
files, services, electronic mailboxes, and other resources. They make
resources available under a variety of naming schemes and
access methods such as HTTP, FTP, and Internet mail addressable in the
same simple way. They reduce the tedium of "log in to this
server, then issue this magic command ..." down to a single click.

It is an extensible technology: there are a number of existing
addressing schemes, and more may be incorporated over time.

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

Reply via email to