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

Re: text html from file to a scalar and mail

Thread Previous | Thread Next
From:
John Plum
Date:
September 16, 2009 06:23
Subject:
Re: text html from file to a scalar and mail
Message ID:
joniplum-C9BE07.14223116092009@ger.gmane.org
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#

Email::MIME->create(
        attributes => {
            content_type => "text/html",
            charset      => "UTF-8",

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

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

>#Results :

>SCALAR(0x83c64d0)

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


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

>Results:
>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  
next.
 http://jakbop.nfshost.com

-- 
--
http://jakbop.nfshost.com


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About