Image::Magick scalar value to print use CGI
am 14.04.2006 04:09:06 von brainbendHas anyone ever had a situation where you where printing a scalar to an
html page (use CGI qw(:standard HTML);) and the scalar would not print?
But you checked it on the command line and the scalar value printed to
the terminal and in the correct place within the html?
If you didn't that is ok - just ignore me, if you did what did you
do?
Here is my code
#!/usr/bin/perl
use Image::Magick;
use CGI qw(:standard HTML);
print header (),
start_html (-title => "test_img3", -bgcolor =>
"darkorange");
file_size();
print end_html ();
exit (0);
sub file_size{
my $image = new Image::Magick;
my $full = 'the_sgm.jpg';
$image->Read($full);
my $value = $image->Get('filesize');
print "flie size is : $value";
}
It prints to command line:
Content-Type: text/html; charset=ISO-8859-1
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
flie size is : 26599
But the 26599 does not show up when I print call the file in html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">