#!/usr/bin/perl use GD; use Tk; use Tk::JPEG; use MIME::Base64; dbmopen %myhash, "myhash", 0666; my $im = GD::Image->new('image.jpg'); my $img = encode_base64($im->jpeg()); $myhash{image} = $img; dbmclose %myhash;