in reply to Resizing image

Might I suggest using CGI.pm's method for this?
# png good, gif bad print img({-src => 'http://myserver/image.png', -width => '500', -height => '60', -alt => 'My Image', -title => 'This is my image', });

It will produce much more readable code, both in your script and in the browser, and you don't have to worry about escaping characters as rigidly as you do with "raw" print() statements.

There's also the resize()/convert() options of Image::Magick, which can do things like:

use strict; use Image::Magick; my $image = Image::Magick->new(); $x = $image->Read(filename =>'image.png'); $x = $image->Resize(geometry =>'640x480'); $x = $image->Write(filename =>'image-th.png', quality =>75); @$image = ();

Lastly, there's HTMLThumbnail, by Benjamin Franz.

Resizing the images sent to the user by sending them the entire "full-size" image, and forcing the browser to resize it as a thumbnail is bad for several reasons:

In short, don't, especially when there are better alternatives.