http://www.perlmonks.org?node_id=145285

rbc has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow Monks,

I wonder if I am doing somthing wrong or is this just
the way tag's in Tk::Text work.
The documentation defines tagBind like so ...

$text->tagBind(tagName, ?sequence?, ?script?)


Please take a look at these code snippets and let me know
if am doing something that is causing my problem

The problem I am dealing with is that when I specify a ?script? like so ...
sub myTagCallback { my $theTextWidget = shift; # I don't know why this shows up! my $str = shift; my $arrRef = shift; my $tableWidget = shift; . . . } . . . $myTextWidget->tagBind ( $myTagName, "<ButtonRelease-1>", [\&myTagCallback, $myString, \@myArrayOArrays, $myTableWidget] ); . . .


What I don't understand is how/why I have to do the ...
my $theTextWidget = shift; # I don't know why this shows up!
... I didn't specify it as an argument in the tagBind call !?!?!?!

Please enlighten me. Thanks!