#!/usr/bin/perl -- ## ## 2014-05-29-18:05:27 ## ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use POSIX qw/ strftime /; use Path::Tiny qw/ path /; #~ Main( @ARGV ); Main( 'C:/TEMP/DAILY.csv', 'C:/TEMP/MONTHLY.csv' ); exit( 0 ); sub Main { my( $infile, $outfile ) = @_; if( not has_today( $outfile ) ) { append_today( $infile, $outfile ); ... ## make noise on STDOUT } else { ... ## make noise on STDOUT } } ## end sub Main sub has_today { my( $infile ) = @_; my $today = strftime( '%Y %m %d', localtime ); my $fh = path( $infile )->open_raw; ... ## read last 8k, check for $today } ## assumes infile will fit in memory, if it don't, write more code :) sub append_today { my( $infile, $outfile ) = @_; path( $outfile )->append_raw( path( $infile )->slurp_raw ); }