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:\/\//, *@opts) returns
> Handle {...}
Well, it's mailto:example@example.com, not mailto://example@example.com.
> 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)>/, *@opts) 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
Thread Previous
|
Thread Next