use LWP::UserAgent; use HTTP::Request; use strict; use warnings; my $ua = new LWP::UserAgent(); $ua->credentials("localhost:8080", "Tomcat Manager Application", "peip", "930612"); my $req; if ($ARGV[0] eq "remove") { $req = new HTTP::Request("GET", "http://localhost:8080/manager/remove?path=/hello1"); } elsif ($ARGV[0] eq "install") { $req = new HTTP::Request("GET", "http://localhost:8080/manager/install?path=/hello1&war=jar:file:/jwstutorial13/examples/web/hello1/dist/hello1.war!/"); } my $res = $ua->request($req); print $res->content();