| 1 | package IO::Die; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 16 | ▶ | sub rmdir { | ||||||||
|
Subroutine
rmdir: called CC=4 SCAR=13.9
| |||||||||||
| 6 | 16 | my ( $NS, @args ) = @_; | |||||||||
| 7 | |||||||||||
| 8 | #Perl's rmdir() doesn’t actually allow batching like this, | ||||||||||
| 9 | #but we might as well prevent anyone from trying. | ||||||||||
| 10 | 16 | ▶ | die "Only one path at a time!" if @args > 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | |||||||||||
| 12 | 12 | ▶ | if ( !@args ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 4 | @args = ($_); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 12 | local ( $!, $^E ); | |||||||||
| 17 | 12 | ▶ | my $ok = CORE::rmdir( $args[0] ) or do { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 4 | $NS->__THROW( 'DirectoryDelete', path => $args[0] ); | |||||||||
| 19 | }; | ||||||||||
| 20 | |||||||||||
| 21 | 8 | return $ok; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 4 | 1; | |||||||||