# ... lots of stuff $entry = new Gtk::Entry(8); $button = new Gtk::Button("Save"); # pass the entry-varible to the sub, if it ain't global $button->signal_connect( "clicked", \&savethings, $entry); # ... lots of more stuff :-) #### sub savethings { # here we receive the entry-widget (and the save-button, too) my ($savebutton,$entry) = @_; # delete text in entry $entry->set_text(""); # save things # ... }