binmode(STDOUT); open(my $img, "images/some.jpg") or print "content-type: text/plain\n\nfailed to open image"; local $/; print "content-type: image/jpeg\n\n"; print <$img>; close $img;