#!/usr/bin/perl use strict; use warnings 'all'; use Tk; my $mw = tkinit; my $c = $mw->Canvas(-background => "white")->pack; print "Jetzt werden die Bindings hinzugefuegt...\n"; $c -> Tk::bind ("", [ sub { shift; # my @op = @{$r->{pos}}; my @np = getXY(@_); print " OP: \@op\n NP: @np\n"; # newpos($r, [$np[0]-$op[0], $np[1]-$op[1]]); }, Ev("x"), Ev("y") ]); MainLoop; sub getXY{ return @_; }