if($page eq "x1a.html") { $re_type = "a2"; $Q = ($prod) ? 'a0' : 'a0'; $send=$sec.$account.$year.$view; } if($page eq "x22.html") { $re_type = "x2"; $Q = ($prod) ? 'p0' : 'w0'; $send=$sec.$account.$year.$view; } if ($page eq "y11.html") { $req_type = "y1"; $Q = ($prod) ? 'p0' : 'w0'; $send=$sec.$account.$year.$view.$action; } if ($send) { got_send(); } sub got_send { my $socket; my $x = ''; my @read = (); my $host = ($prod) ? 'my.prod.com' : 'mytest.box.com'; my $port; # Alternate depending on the time (in seconds) ($now[5] % 2) ? ($port = 6000) : ($port = 6100); $AoH{300} = sprintf "%2s(%d) %s", $QPro, ($port/100), $send; $socket = IO::Socket::INET->new( "$host:$port" ) or &error; print $socket "\n \n \n $re_type\n $send\n $Q \n \n"; $x = <$socket>; close(Server); $x=~s/' } # Prevent uninitialzed message on $1 $y=~/<(.*?)>(.*)/; if($1 eq "7"){$name = $2;} #more code here.... last if ($x =~ /^[\s\x00]*$/); } } #End of sub #### <1>66543 <2>2009 <3>TY <4>- <6> <7>TOM <8>2 - DUNDAS <8>100 - MAIN <9>ONT 00001 <10> <11>000-000-0000 <12> #### <1>66543 <2>2009 <3>TY <4>- <6> <7>TOM <8>2 - DUNDAS <8>100 - MAIN <9>ONT 00001 <10> <11>000-000-0000 <12> <1>12345 <2>1999 <3>PP <4>XLX - TEST <6>Comm <7> <8>1 BLVD <9>MA 00001 <10>CITI, INC. <11>000-000-0000 <12> <1>8887 <2>2000 <3> <4>TEST <6> <7>JOE <7>MARY <8>100 MAIN <9>CT 02221 <10>BH, INC. <11>871-000-0000 <12>YEAR