#!/usr/bin/perl use strict; use warnings; use File::Spec; use Time::HiRes; use Tk; use Tk::Animation; my $path = shift || die 'need an image'; die 'image not found' if not -e $path; my $size = -s $path; my $mw = MainWindow->new; $mw->configure(-title => $path); my $top = $mw->Frame()->pack(); my $start = Time::HiRes::time; my $image = $mw->Animation(-format => 'gif', -file => $path); print 'Tk::Animation took ', Time::HiRes::time - $start, " seconds for $size bytes \n"; my $label = $top->Label(-image => $image)->pack(); $image->start_animation; MainLoop;