my $window = Gtk2::Window->new( "toplevel" )->call_method_list( signal_connect => [ delete_event => sub { Gtk2->main_quit } ], set_title => "Test", set_border_width => 15, add => Gtk2::Button->new( "Quit" )->call_method_list( signal_connect => [ clicked => sub { Gtk2->main_quit } ] ), 'show_all', ); #### use Carp qw( croak ); sub UNIVERSAL::call_method_list { my $target = shift; while ( scalar @_ ) { my $method = shift @_; my @args = (! scalar @_) ? () : (ref($_[0]) eq 'ARRAY') ? @{shift} : shift; eval { $target->$method( @args ) }; if( $@ ) { croak( $@ ) } } return $target; }