#!/usr/bin/perl use IO::Socket; #SET WHERE CAMERA IS $sock = new IO::Socket::INET (PeerAddr => '192.168.168.203', PeerPort => 4321, Proto => 'tcp', Timeout => 1); select(undef, undef, undef, 0.5); $sock->send("0110\n"); $sock->read($size, 2); $sock->read($j1, 1); $sock->read($j2, 1); $j1=oct("0x".unpack("H*", $j1)); $j2=oct("0x".unpack("H*", $j2)); $size=oct("0x".unpack("H*", $size)); if ($size != 0) { $sock->read($data, $size); print "Content-type: image/jpeg\n\n"; print $data; }