blib/lib/Process/Backgroundable.pm

filter: Statementstmt 100% 31 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 100% 41 / 41 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Process::Backgroundable;
2  
3 4 ▶use 5.005;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Storable ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use File::Temp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use IPC::Run3 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Process::Storable ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use vars qw{$VERSION @ISA @PERLCMD};
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 $VERSION = '0.21';
13 4 @ISA = 'Process::Storable';
14  
15 # Contains the command to use to launch perl
16 # Should be the path to the perl current running.
17 # People with special needs should localise this
18 # to add any flags.
19 4 @PERLCMD = ( $^X );
20 }
21  
22 1 ▶sub background {
Subroutine background: called CC=1 SCAR=0.0
Pod documented
23 1 my $self = shift;
24  
25 # Dump the object to the input filehandle
26 1 my $stdin = File::Temp::tempfile();
27 1 $self->serialize( $stdin );
28 1 seek( $stdin, 0, 0 );
29  
30 # Generate the command
31 1 my $cmd = [ @PERLCMD, '-MProcess::Launcher', '-e serialized', ref($self) ];
32  
33 # Fire the command
34 1 IPC::Run3::run3( $cmd, $stdin, \undef, \undef );
35  
36 1 return 1;
37 }
38  
39 4 1;
40  
41 __END__
↑ Summary