#!/usr/bin/perl use strict; use warnings; use CGI qw(:all); my $q = CGI->new; print $q->header(-type => 'image/gif'); open(my $F, '<', '1.gif') || die "can not open\n"; local $\ = undef; print <$F>; close($F);