Skip to content

Instantly share code, notes, and snippets.

@lestrrat
Created September 7, 2011 08:33
Show Gist options
  • Save lestrrat/1200059 to your computer and use it in GitHub Desktop.
Save lestrrat/1200059 to your computer and use it in GitHub Desktop.
use strict;
use Devel::Cover;
my $pid = fork();
if ( $pid ) {
wait;
} else {
system "/bin/ls"; # shows output of ls on my console
# exec "/bin/ls"; # doesn't show output of ls :/
}
use strict;
use Devel::Cover;
my $pid = fork();
if ( $pid ) {
wait;
} else {
Devel::Cover::report(); # dies
exec "/bin/ls";
}
use strict;
use Devel::Cover;
my $pid = fork();
if ( $pid ) {
wait;
} else {
# WORKS!!!!
eval { Devel::Cover::report() };
exec "/bin/ls";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment