Today around 1:08pm, Jonathan Scott Duff hammered out this masterpiece:

: Where are these handlers registered?  How are they registered?  In my
: mind I was thinking that we could just name our handlers as packages
: so that 
: 
:       $fh = open "http://www.perl.com";               # and
:       $fh = open myhttp "http://www.perl.com"; 
: 
: would cause Perl to search @INC for http.pm and myhttp.pm and auto-use
: them.

Which is interesting... I have been pondering this for some time.

Imagine, if you will, a common ( perhaps ) routing such as:

use LWP::Simple;

my $url = 'http://my.homepage.com';

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";

I'm assuming now, that Perl is going to look at this and say 'http://'
looks like a URL, autoload `http.pm`?  Isn't this flawed?  Or does one
have to register all 'handlers' manually?

This ( manual registration ) seems a tad counter intuitive if we just
want:

open "http://my.homepage.com"; # the URL

to read the actual web page.  One would assume that this is taken care of
for you, in which case:

open "http://my.homepage.com"; # the file

now get's the wrong data ( from the web ).  And one can only assume that
an operation such as:

no register 'http';

is required to stop this 'default' behavior.

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.

-- 
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>

Reply via email to