| 1 | package App::PerlShell::Plugin::ShellCommands; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | ######################################################## | ||||||||||||||
| 4 | # AUTHOR = Michael Vincent | ||||||||||||||
| 5 | # www.VinsWorld.com | ||||||||||||||
| 6 | ######################################################## | ||||||||||||||
| 7 | |||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 1 | ▶ | use Pod::Usage; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 1 | ▶ | use Pod::Find qw( pod_where ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | |||||||||||||||
| 13 | 1 | our $caller = caller; | |||||||||||||
| 14 | |||||||||||||||
| 15 | 1 | my $App_PerlShell_Plugin_ShellCommands = " | |||||||||||||
| 16 | package $caller; | ||||||||||||||
| 17 | |||||||||||||||
| 18 | our \$AUTOLOAD; | ||||||||||||||
| 19 | |||||||||||||||
| 20 | sub AUTOLOAD { | ||||||||||||||
| 21 | my \$program = \$AUTOLOAD; | ||||||||||||||
| 22 | my \$retType = wantarray; | ||||||||||||||
| 23 | |||||||||||||||
| 24 | \$program =~ s/^.*:://; | ||||||||||||||
| 25 | my \@rets = `\$program \@_`; | ||||||||||||||
| 26 | |||||||||||||||
| 27 | if ( not defined \$retType ) { | ||||||||||||||
| 28 | print \@rets; | ||||||||||||||
| 29 | return; | ||||||||||||||
| 30 | } elsif ( \$retType ) { | ||||||||||||||
| 31 | return \@rets; | ||||||||||||||
| 32 | } else { | ||||||||||||||
| 33 | return \\\@rets; | ||||||||||||||
| 34 | } | ||||||||||||||
| 35 | } | ||||||||||||||
| 36 | |||||||||||||||
| 37 | sub DESTROY { return } | ||||||||||||||
| 38 | |||||||||||||||
| 39 | 1; | ||||||||||||||
| 40 | "; | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 0 | ▶ | eval $App_PerlShell_Plugin_ShellCommands; | ||||||||||||
|
Subroutine
AUTOLOAD: not called CC=3 SCAR=23.3
Subroutine
DESTROY: not called CC=1 SCAR=6.0
Branch: 2 branches
| |||||||||||||||
| 43 | |||||||||||||||
| 44 | 1 | ▶ | use Exporter; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 45 | |||||||||||||||
| 46 | 1 | our @EXPORT = qw( | |||||||||||||
| 47 | ShellCommands | ||||||||||||||
| 48 | ); | ||||||||||||||
| 49 | |||||||||||||||
| 50 | 1 | our @ISA = qw ( Exporter ); | |||||||||||||
| 51 | |||||||||||||||
| 52 | 0 | ▶ | sub ShellCommands { | ||||||||||||
|
Subroutine
ShellCommands: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 53 | 0 | pod2usage( | |||||||||||||
| 54 | -verbose => 2, | ||||||||||||||
| 55 | -exitval => "NOEXIT", | ||||||||||||||
| 56 | -input => pod_where( {-inc => 1}, __PACKAGE__ ) | ||||||||||||||
| 57 | ); | ||||||||||||||
| 58 | } | ||||||||||||||
| 59 | |||||||||||||||
| 60 | 1 | 1; | |||||||||||||
| 61 | |||||||||||||||
| 62 | __END__ | ||||||||||||||