package Devel::Stop; use strict; use warnings; sub DB::DB { # Execute the code you want to run here my $result = main::foo(); print STDERR "1..2\n"; print STDERR ((defined $result ? "ok 1" : "not ok 1")," - got a value\n"); print STDERR (($result eq "I am foo" ? "ok 2" : "not ok 2"), " - right value\n"); exit(0); } 1;