From: Brad Gilbert Date: Tue, 7 Dec 2010 23:16:56 +0000 (-0600) Subject: Modified unlink_all in t/test.pl to return the count of unlinked files This will... X-Git-Tag: accepted/trunk/20130322.191538~6584^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55b0687d8bc1aa7e911b5fd2678ea7e8dbe6f059;p=platform%2Fupstream%2Fperl.git Modified unlink_all in t/test.pl to return the count of unlinked files This will make it so that it can be a drop-in replacement for unlink --- diff --git a/t/test.pl b/t/test.pl index bfda110..a558820 100644 --- a/t/test.pl +++ b/t/test.pl @@ -630,10 +630,16 @@ sub which_perl { } sub unlink_all { + my $count = 0; foreach my $file (@_) { 1 while unlink $file; - _print_stderr "# Couldn't unlink '$file': $!\n" if -f $file; + if( -f $file ){ + _print_stderr "# Couldn't unlink '$file': $!\n"; + }else{ + ++$count; + } } + $count; } my %tmpfiles;