Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Dispatchers for dummies

by sri (Vicar)
on Oct 14, 2008 at 22:46 UTC ( #717110=note: print w/replies, xml ) Need Help??


in reply to Re: Dispatchers for dummies
in thread Dispatchers for dummies

I would like to support Perl 5.8, apart from the fact that raw regex looks quite ugly.
A huge advantage of patterns like i'm using them is that you can rebuild the path very easily.

The /foo/123 /foo/abc example is already possible since patterns get compiled to regex internally.
$r->route('/:(number)_:(word)/foo', number => qr/\d+/, word => qr/\w+/ +)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://717110]
help
Chatterbox?
[PriNet]: quick question... anyone know how to remove all the existing keys in a %hash ? i've tried several options, but when i re-use the hash, some of the "upper" keys that i don't re-use stick and i can't get them to "remove"
[atcroft]: PriNet: %hash = ();? or foreach my $k ( keys %hash ) { delete $hash{$k}; }?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2017-06-28 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (619 votes). Check out past polls.