develooper Front page | perl.perl6.language | Postings from April 2005

Re: -X's auto-(un)quoting?

Thread Previous | Thread Next
From:
Juerd
Date:
April 22, 2005 11:24
Subject:
Re: -X's auto-(un)quoting?
Message ID:
20050422182425.GG19716@c4.convolution.nl
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About