On Fri, 20 Apr 2007 18:55:56 +0100
Andy Armstrong <[EMAIL PROTECTED]> wrote:

> could optionally be
> 
>    '/photos/album${ALBUM:\d+:%04d}/photo${PHOTO:\d+:%04d}.jpg'
> 
> to get back strings like
> 
>    '/photos/album0123/photo0001.jpg'

An interesting idea, but what does that buy you that a plain sprintf does
not?

  $pr->build( { ALBUM => sprintf("%04d", $album),
                PHOTO => sprintf("%04d", $photo) } )

In this example with numbers as the keys perhaps it looks useful, but
isn't that a special case? In most cases, we couldn't do anything special
like zero-pad the numbers.

For example, if we had users in groups:

 '/groups/${GROUP:\w+}/users/${USER:\w+}.html'

There's no other printf format of any interest that comes to mind, other
than %s.

-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: PGP signature

Reply via email to