#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use strict;
use warnings;
use lib ( "$ENV{'DOCUMENT_ROOT'}/../lib", "$ENV{'DOCUMENT_ROOT'}/../..
+/prod/lib" );
use Bod::CRM;
use Site::Utils;
use Data::Dumper;
print "Content-type: text/plain\n\n";
print Dumper $file{'receipt', 'file'};
exit;
This gives me a 500 error which is not picked up by CGI::Carp
But - I've tried printing out to a file and $file{'receipt', 'file'} contains the contents of a JPEG image file. Can die and print not handle some encoded characters such as those in an image file?
I am trying to debug some code that handles file uploads from a webpage and came across this strange behaviour of die working in some places and not others. So I created a simple example to demonstrate it. But it seems it's an encoding issue that is something I am getting everywhere from .htaccess files to blog editing since moving servers 😒 |