#!/usr/bin/perl -w use Tk; use DBI; my $dbh = DBI->connect("DBI:mysql:TEST;host=localhost","joe",""); my $Main=MainWindow->new(); $Main->minsize( qw(250 250)); $Main->maxsize( qw(250 250)); $Main->title("Eintest"); $Main->configure(-background=> 'blue' ); my $top=$Main->Frame(-background=> 'blue',)->pack(-side=>'top',-fill=>'both' ); $CELL = $top->Entry(-width=>10, -background=>'white', -textvariable =>\$EIN)->pack(-side=>'left' ); $CELL->bind("",&Schreiben); sub Schreiben { my $sth2 = $dbh->prepare("insert into Test (Name) values($EIN); $sth->execute; }