<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Thanks Kõike hääd,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">But I can't get this going.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><b><i><u>My Sample Code:<o:p></o:p></u></i></b></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">sub TEST {<o:p></o:p></p>
<p class="MsoPlainText"> my $name = param('test');<o:p></o:p></p>
<p class="MsoPlainText"> my $ID = param('ID');<o:p></o:p></p>
<p class="MsoPlainText"> return {Message => "Welcome to Montoo Update Event $name $ID"};<o:p></o:p></p>
<p class="MsoPlainText">}<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">get '/method/Entity=:test&ID=:ID' => \&TEST;<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Let me Know in case of any further informations required.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks<o:p></o:p></p>
<p class="MsoPlainText">Anand.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On Behalf Of WK<br>
Sent: Wednesday, September 16, 2015 3:40 PM<br>
To: Perl Dancer users mailing list<br>
Subject: Re: [dancer-users] How to pass Named Arguments in Dancer URL</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">2015-09-16 12:39 GMT+03:00 Parthiban, Anandaraaj <<a href="mailto:anandaraj.parthiban@cgi.com"><span style="color:#1F497D;text-decoration:none">anandaraj.parthiban@cgi.com</span></a>>:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">> But How do we pass that<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> Let me Know in case of any further informations required.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">get '/method' => sub {<o:p></o:p></p>
<p class="MsoPlainText"> # you have two ways to access params from query string :<o:p></o:p></p>
<p class="MsoPlainText"> # first, there is Dancer keyword `param`<o:p></o:p></p>
<p class="MsoPlainText"> my $name = param('name');<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> # second, there is Dancer method `params`<o:p></o:p></p>
<p class="MsoPlainText"> my $id = params->{ 'id' };<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> # do whatever you need here<o:p></o:p></p>
<p class="MsoPlainText">};<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Wbr,<o:p></o:p></p>
<p class="MsoPlainText">-- <o:p></o:p></p>
<p class="MsoPlainText">Kõike hääd,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Gunnar<o:p></o:p></p>
<p class="MsoPlainText">_______________________________________________<o:p></o:p></p>
<p class="MsoPlainText">dancer-users mailing list<o:p></o:p></p>
<p class="MsoPlainText"><a href="mailto:dancer-users@dancer.pm"><span style="color:#1F497D;text-decoration:none">dancer-users@dancer.pm</span></a><o:p></o:p></p>
<p class="MsoPlainText"><a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users"><span style="color:#1F497D;text-decoration:none">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</span></a><o:p></o:p></p>
</div>
</body>
</html>