tomazos has asked for the wisdom of the Perl Monks concerning the following question:
Suppose there is a function that generates one file based on another:
sub compile($$) { my ($source_filename, $output_filename) = @_; ... # compile source into output }
and now we only want to execute the function if $source_filename has been modified more recently than $output_filename...
sub compare_modification_times($$) { my ($file_a, $file_b) = @_; ??? } my $src = "wee.foo"; my $dest = "wee.bar"; if (compare_modification_times($src, $dest) < 0) { compile($src, $dest); }
I would like recommendations on the most robust and portable way to implement compare_modification_times. Any ideas?
Thanks for your time.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Comparing modification times like make
by Anonymous Monk on Oct 27, 2008 at 12:52 UTC | |
Re: Comparing modification times like make
by Krambambuli (Curate) on Oct 27, 2008 at 12:57 UTC | |
by cdarke (Prior) on Oct 27, 2008 at 13:40 UTC | |
Re: Comparing modification times like make
by JavaFan (Canon) on Oct 27, 2008 at 12:54 UTC |
Back to
Seekers of Perl Wisdom