in reply to Re^7: Pass the value from perl script to html page
in thread Pass the value from perl script to html page

but if I can get the values from html page by using following lines 'my $query = new CGI;' 'my $sirName = $query ->param("sirName");' why I cant do the same to pass values from perl to html...
  • Comment on Re^8: Pass the value from perl script to html page

Replies are listed 'Best First'.
Re^9: Pass the value from perl script to html page
by gellyfish (Monsignor) on May 04, 2005 at 11:13 UTC

    Er, because you can't. Please review the fine documentation on HTML and associated technologies at http://www.w3c.org to confirm this for yourself.

    /J\

      but if I can get the values from html page by using following lines

      my $query = new CGI; my $sirName = $query ->param("sirName");

      why I cant do the same to pass values from perl to html...

      If we are to interpret your statement literally, gellyfish is correct, the above lines of code will not send a query string from your perl code to your html page. However, gellyfish is also mistaken regarding HTML; it is entirely possible to pass a query string between pages using either the GET or POST methods, which CGI fully supports.

      If you want your cgi to work as a redirection page, merely forwarding the query string, this is possible as well. You can either append the query string to the redirect and send the form via GET or you can try to use POST. While I could not find any equivalent to Javascript's .submit() method in the CGI:: modules, you can accomplish this by creating your own user agent.

      Both methods are documented in Chapter 20, Section 2 of The Perl Cookbook.

      .....OK ...:-( again lot of work for me, any way thanks for u......:-(

        It looks like a lot of work now, but trust us, creating templates and gaining an understanding of the technology you are using will save you a lot of time.

Re^9: Pass the value from perl script to html page
by wazoox (Prior) on May 04, 2005 at 11:15 UTC
    You open the html file and process it the way I showed you in the example I wrote, or using HTML::Template if you need elaborate tricks.