develooper Front page | perl.beginners | Postings from September 2009

Re: text html from file to a scalar and mail

Thread Previous | Thread Next
John Plum
September 16, 2009 06:23
Re: text html from file to a scalar and mail
Message ID:
Well thanks to Shlomi and Jenda. I followed up the reccommendation for 
slurp, investigated some solutions, and targetted File::Slurp, with two 
tests, and some interesting results, which follow. 

use CGI;
use warnings;
use diagnostics;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/

use File::Slurp;
my $signature_ref =
  read_file( "file.html", scalar_ref => 1 ) or die "Couldn't open 
$signature_ref $!";

#TEST 1#

        attributes => {
            content_type => "text/html",
            charset      => "UTF-8",

            #            encoding     => "quoted-printable",
            disposition => "attachment",

            #            format       => "flowed",
        body => $customer_msg_html,

>#Results :


>(I found the same result with the variable handled as $signature ref)

#Test 2#
print "Content-type: text/html\n\n";
Print  "${signature_ref}";

>differed on my server provider (Apache), and local client( lighttpd); 
it printed on client not on public server, where i got: 
SCALAR(0x83c64d0). I checked carefully to see if the file input was 
read. I have no  clues as to why.

This still leaves me without a solution though. Not sure where to go  


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About