my $path = "/pacer/bancap/web/images"; my $file = $ENV{PATH_INFO}; $file =~ s#^[^/]*##; $file =~ s#[^/\d-\.\w]##g; $path .= $file; print "Content-Type: application/pdf\n"; my $size = -s $path; print "Content-length: $size\n"; print "\n"; print `cat $path`;