| 1 | package File::ShouldUpdate; | ||||||||||
| 2 | 2 | $File::ShouldUpdate::VERSION = '0.0.1'; | |||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use Time::HiRes qw/ stat /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use parent 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use vars qw/ @EXPORT_OK /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | @EXPORT_OK = qw/ should_update /; | |||||||||
| 10 | |||||||||||
| 11 | sub should_update | ||||||||||
| 12 | { | ||||||||||
| 13 | 2 | ▶ | my ( $filename2, $syntax_sugar, @deps ) = @_; | ||||||||
|
Subroutine
should_update: called CC=5 SCAR=16.4
Pod
documented
| |||||||||||
| 14 | 2 | ▶ | if ( $syntax_sugar ne ":" ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | { | ||||||||||
| 16 | 0 | die qq#wrong syntax_sugar - not ":"!#; | |||||||||
| 17 | } | ||||||||||
| 18 | 2 | my @stat2 = stat($filename2); | |||||||||
| 19 | 2 | ▶ | if ( !@stat2 ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | { | ||||||||||
| 21 | 1 | return 1; | |||||||||
| 22 | } | ||||||||||
| 23 | 1 | foreach my $d (@deps) | |||||||||
| 24 | { | ||||||||||
| 25 | 2 | my @stat1 = stat($d); | |||||||||
| 26 | 2 | ▶ | return 1 if ( $stat1[9] > $stat2[9] ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | } | ||||||||||
| 28 | 1 | return 0; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 2 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||