++polettix. This is a snippet of code I use for my perl client to get results from a tomcat server using LWP::UserAgent (but modified here to pull from the monastery).

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $url = "http://www.perlmonks.org/?displaytype=xml;node_id=609084"; # Create a user agent my $ua = LWP::UserAgent->new; # Set the user agent string - useful for spelunking logs $ua->agent( "myapp" ); # Get the data my $res = $ua->get( $url ); # Check the outcome of the response if( $res->is_success ) { print $res->content, "\n"; }
I do this all the time ... the perl cgi-script (or mod_perl handler) will parse params, construct a url, fetch data (normally xml), and then format the fetched data.

-derby

Update: removed the extraneous use of HTTP::Request ... thanks polettix


In reply to Re^2: PERL with JSP interaction by derby
in thread PERL with JSP interaction by natarajan01

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.