in reply to Automatic canvas content rescaling
perl -MTk -we "$m=tkinit;$c=$m->Canvas->pack(-fill=>'both',-expand=>1) +;$m->Button(-command=>sub{print $c->width})->pack;MainLoop;" [download]