in reply to Re^10: Need to know the process to implement perl script into web application server.
in thread Need to know the process to implement perl script into web application server.

For reasons unknown to me, you removed the population of $args from the sub. But what's the contents of @_ outside of a sub?

Also note that $args and @arg are two totally unrelated variables of a different type and name. When chatting with friends, one doesn't have to be always precise, but when programming, every detail matters.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re^11: Need to know the process to implement perl script into web application server.
  • Download Code

Replies are listed 'Best First'.
Re^12: Need to know the process to implement perl script into web application server.
by chandantul (Scribe) on May 23, 2021 at 05:33 UTC

    Hello Sir, How can i add multiple sub program under single query.tt in my Dancer2 app? Please check my current code but i would like add redio buttons for multiple app and its respective submit buttons , If i hit any of the redio buttons then its targetting to to main program only. but i will need its should target its respective sub program

    My Current query.tt

    <form id="f1" method="post" action="/"> <style> body { background-color: #ABBAEA; } div { height: 200px; background-color: #FBD603; } </style> <body> <div> <p>Synchrony OKTA MFA N +etwork Analysis Report Automated Application </p> <label for="APPID">Application ID</label> <input id="text" name="APPID"> <label for="date">Time in Hours</label> <input id="date" name="date"> <label for="Email">Recipient Email</label> <input id="email" name="Email"> <button>Submit</button> </div> <div> <input type="radio" name="Preview Users List"> <label for="Preview Users List">OKTA Preview Users List</label> <button>Submit</button> </div> </body> </form> <form id="f11" method="post" action="/"> <style> body { background-color: #ABBAEA; } div { height: 200px; background-color: #FBD603; } </style> <body> <div> <input type="radio" name="Preview Users List"> <label for="Preview Users List">OKTA Preview Users List</label> <button>Submit</button> </div> </body> </form>
      This is not related to Dancer. You specified two forms (BTW, <body> can't be an ancestor of <form>), so use different actions for them. Or use a single form, but somehow differentiate the submit buttons.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        Hello Sir, I have written separate function for the other lable but its still targeting to first function. is this possible for you let me know where i am wrong here?

        Please check below details for webapp.pm , query.tt .help me if possible.

        query.tt

        <form id="f1" method="post" action="/"> <style> body { background-color: #ABBAEA; } div { height: 200px; background-color: #FBD603; } </style> <body> <div> <p> Report Automated Ap +plication </p> <label for="APPID">Application ID</label> <input id="text" name="APPID"> <label for="date">Time in Hours</label> <input id="date" name="date"> <label for="Email">Recipient Email</label> <input id="email" name="Email"> <button>Submit</button> </div> <div> <input type="radio" name="UsersList"> <label for="UsersList">Users-List</label> <label for="Email">Recipient Email</label> <input id="email" name="Email"> <button>Submit</button> </div> </body> </form>

        webapp.pm

        package webapp; use Dancer2; #use Dancer::Plugin::RequireSSL; use Op; use Op1; our $VERSION = '0.1'; #require_ssl(); get '/' => sub { template 'query' => { 'title' => 'webapp' }; }; post '/' => sub { my $r = Op::result({APPID => param('APPID'), date => param('date'), Email => param('Email')}); template result => { title => 'webapp', result => $r } }; post '/' => sub { my $r2 = Op1::result2({UsersList => param('Users-List'), Email => param('Email')}); template result => { title => 'webapp', result2 => $r2 } }; true;
          A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.