in reply to Using Perl/Tk text tags

tagPrevrange is exactly what you're searching for. Check in documentation for it and use it in conjunction with 'current' tag which means current mouse position. So you need following (unchecked but taken out from my working program) code:
$text->tag('bind','your-tag','<Button-1>'=>sub { my $var = $text->get($text->tagPrevrange('your-tag','current')); # and here do something with $var });

Also, 'widget' program, which comes with Tk distribution, greatly helps to answer similar questions, because it allows you to see a code that implements a behaviour that is currently demonstrated.

update: 'current' is a *mark* and not a tag

Best wishes,
I.R.Baboon.

Replies are listed 'Best First'.
Re: Re: Using Perl/Tk text tags
by Anonymous Monk on Jun 14, 2002 at 17:22 UTC
    Exactly what I needed. Thank you very much.