| 1 | package IO::Die; | ||||||||||
| 2 | |||||||||||
| 3 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | #NOTE: To get stat(_), do stat(\*_). | ||||||||||
| 6 | 34 | ▶ | sub stat { | ||||||||
|
Subroutine
stat: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||
| 7 | 34 | my ( $NS, $path_or_fh ) = @_; | |||||||||
| 8 | |||||||||||
| 9 | 34 | local ( $!, $^E ); | |||||||||
| 10 | |||||||||||
| 11 | 34 | ▶ | my $ret = wantarray ? [ CORE::stat($path_or_fh) ] : CORE::stat($path_or_fh); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | |||||||||||
| 13 | 34 | ▶ | if ($^E) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 1 | ▶ | if ( __is_a_fh($path_or_fh) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 0 | $NS->__THROW('Stat'); | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 1 | $NS->__THROW( 'Stat', path => $path_or_fh ); | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 33 | ▶ | return wantarray ? @$ret : $ret; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 1 | 1; | |||||||||