sub mobileDevice(){ use IO::Socket; my $sock = new IO::Socket::INET ( PeerAddr => '192.168.1.1', PeerPort => '3024', Proto => 'tcp', ); die "Could not create socket: $!\n" unless $sock; print $sock "GET http://192.168.2.1:8080/campus_tour/Demo/photo_01.jpg HTTP/1.0\n"; print $sock "Content-Length: 0\n"; print $sock "Host: 192.168.2.1\n"; print $sock "User-Agent: EricssonT200\r\n\r\n"; $chk = 0; while ( ($response = <$sock>) && $chk==0 ){ if ( $response =~ /Connection: close/ ){ $chk = 1; } } while ( $response = <$sock> ){ print "$response\n"; } close($sock); }