Mark Overmeer via RT wrote:
Show quoted text> Now,
> my $b = MIME::Body::InCore->new(\"hi");
> my $fh = $b->open("r");
> print <$fh>;
Show quoted text> prints SCALAR(0x....)
I cannot replicate this with MIME-Tools 5.423. It prints the body
as expected. This script I use is:
#============================
use strict;
use warnings;
use MIME::Tools;
use MIME::Body;
my $b = MIME::Body::InCore->new(\"hi\n");
my $fh = $b->open("r");
print <$fh>;
#============================
Please drop the following test case into the t/ directory and let me know
what it does.
Regards,
David.
### Drop this in as t/BodyPrint.t
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More tests => 7;
use MIME::Body;
use MIME::Tools;
my $body = MIME::Body::InCore->new("hi\n");
my $fh = $body->open("r");
my @ary = <$fh>;
$fh->close();
is(scalar(@ary), 1);
is($ary[0], "hi\n");
$body = MIME::Body::InCore->new(\"hi\n");
$fh = $body->open("r");
@ary = <$fh>;
$fh->close();
is(scalar(@ary), 1);
is($ary[0], "hi\n");
$body = MIME::Body::InCore->new(["line 1\n", "line 2\n"]);
$fh = $body->open("r");
@ary = <$fh>;
$fh->close();
is(scalar(@ary), 2);
is($ary[0], "line 1\n");
is($ary[1], "line 2\n");