my $bar = sub { print shift }; sub foo { print "Hello\n"; $bar->( "Saluton mondo!\n" ); } foo(); $bar->( "Hello world!\n" );