in reply to Dancer param rewrite

There's Dancer::Plugin::Params::Normization. Perhaps a bit heavy (you'll have to write a custom class), but the overview indicates this functionality is there for the exact reason you've posted.

Replies are listed 'Best First'.
Re^2: Dancer param rewrite
by Skeeve (Parson) on Jan 24, 2014 at 06:15 UTC

    Sorry, but no. I read the description as normalization of the parameter names. So whether someone supplied "NAME=John" or "name=John" to the path, the result will be that the parameter name becomes "name" when "lowercase is set as normalization.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      Yes, that is the example, but read a bit further on the part about the custom class...
      normalize($hashref) Receives a hashref that contains the parameters keys/value. It should +return a hashref (it can be the same), containing modified parameters +.
      Sounds like you can modify values as well, since you're returning a hashref with both keys and values.

        Okay... It was not that obvious, but you're right. It seems like it could be useful for my purpouse.

        Will check. Thank you.


        s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
        +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e