Matt skribis 2005-04-22 14:20 (-0400):
> Well why can't you define the functions like so:

Because a URI scheme ends in :. It http: followed by anything other than
// should fail because it is invalid, not fall back to file handling.
IFF you're handling URIs.

>       multi sub open ($u of Str where /^mailto:\/\//, [EMAIL PROTECTED]) 
> returns 
>       Handle  {...}

Well, it's mailto:[EMAIL PROTECTED], not mailto://[EMAIL PROTECTED]

> Also, I don't know much about rules with regex yet, but could you do  
> something like...
>       multi sub open ($u of Str where /<protocol(file)>/, [EMAIL PROTECTED]) 
> returns  
> Handle {...}
> Where < <protocol(file)> > expands to < file:// >

Yes, but it's probably easier to just use a hash: %protocol<file>.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Reply via email to