[Dancer-users] Routes with captures

Daniel Pittman daniel at rimspace.net
Tue Jun 1 09:21:42 CEST 2010


Alexis Sukrieh <sukria at sukria.net> writes:
> On 31/05/2010 20:18, Marc Chantreux wrote:
>> On Mon, May 31, 2010 at 10:20:48PM +1000, Daniel Pittman wrote:
>>>>      r('/stuff/(.*+))
>>>>      qr/\/stuff\/(.*+)/
>>> Er, isn't 'r' it literally identical to 'qr(/stuff/(.*+))' in this case?
>>
>> yes it is! plus: you don't have to know what r() do: qr is just a perl
>> operator.
>>
>>>> So I would vote for applying your patch, but without replacing r('') which
>>>> has a good reason to live, I think.
>>>
>>> The only really good reason I can see, right now, is backward compatibility,
>>
>> +1
>
> After reading the whole thread, I must say this makes sense. Now I see r()
> as something akward and unlogical.  We can say that any call to r() will now
> trigger a warning like: "the r() method is deprectated, use qr// instead".

If I may, suggesting 'qr()' or 'qr{}' is probably nicer, not least because
this will also work with them:

   qr{/one/{[-0-9a-f]{24}}/frob}

Nesting brackets, as long as they are balanced, is nice, and is one of the
attractions of the 'r' method to me.

        Daniel

-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons


More information about the Dancer-users mailing list