print "Content-type: image/jpeg\n\n"; binmode(STDOUT); foreach $i (1..2){ open(F, "$i.jpg"); binmode(F); print join("",); close(F); }