++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).
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.#!/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"; }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |