8
$inf_url = "http://hpeat127.fzk.de:8000/cmd.html";
10
#$proxy = "http://proxy.fzk.de:8000";
14
$ua=new LWP::UserAgent;
15
if ($proxy) { $ua->proxy(['http','ftp'],$proxy); }
20
my $url = new URI::URL($req_url);
21
my $hdr = new HTTP::Headers("Referer"=>$url);
22
$hdr->authorization_basic($user, $pass);
23
my $req = new HTTP::Request("GET",$url,$hdr);
24
my $resp = $ua->request($req);
25
my $status = $resp->content;
28
while ($status =~ /socket\((\d+)\s*,([^,]+)\s*,(\d+)\s*,(\d+)\s*\)/g) {
40
Example: $0 'P1=1&P2=0'
41
$0 val1 val2 val3 val4
48
if (($#ARGV>0)||($ARGV[0] =~ /^\d+$/)) {
50
foreach ($i = 0; $i <= $#ARGV; $i++) {
51
if ($i) { $POST .= "&"; }
52
$POST .= "P".($i+1)."=".$ARGV[$i];
61
$url = new URI::URL($cmd_url);
62
$hdr=new HTTP::Headers("Referer"=>$cmd_url);
63
$hdr->authorization_basic($user, $pass);
64
$req = new HTTP::Request("POST",$url,$hdr,$POST);
65
$req->content_type('application/x-www-form-urlencoded');
66
$resp = $ua->request($req);
68
if (($resp->content =~ /401\s+Authorization\s+Required/i)&&(--$i>0)) { goto RETRY; }
69
print($resp->content . "\n");