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

Hello :)

how can I substitute eg letters a and b in an entry?
So when I type a, then it should be replaced with c or 
whatever.

thanks

$top->Entry( -width => 20, -textvariable => \$data, -validate => 'key', -vcmd => sub {$_[1] =~ /[ab]/} )->pack( -side => 'left' );

Replies are listed 'Best First'.
Re: tk::Entry substitute with validate
by Anonymous Monk on Feb 24, 2006 at 15:02 UTC
    Modify -validatecommand to accomplish that