smturner1 has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use diagnostics; use autodie; use File::Copy::Recursive qw( rcopy ); use File::Path qw( mkpath remove_tree ); use File::Glob qw( :globally ); use File::Find; use File::Spec; use Getopt::Long; use Pod::Usage; use POSIX qw(strftime); use File::Spec::Functions; sub DirCompare{ my ( %old_list, %new_list, @diffs); for my $file (findfiles($ARCHIVE) ) { $old_list{$file} = 1; } for my $file (findfiles($SourceDir) ) { $new_list{$file} = 1; } for my $file (sort keys %old_list) { if ( !defined $new_list{$file} ) { push @diffs, "Old file not in new: $file"; } } for my $file (sort keys %new_list) { if ( !defined $old_list{$file} ) { push @diffs, "Old file not in new: $file"; } } if (@diffs) { my $msg = sprintf "WARNING: %s\n", join "\nWARNING: ", @errors; check_ok( $msg ); } return; }
Undefined subroutine &main::findfiles called at deploy.pl line 154 (#1) (F) The subroutine indicated hasn't been defined, or if it was, it has since been undefined. Uncaught exception from user code: Undefined subroutine &main::findfiles called at deploy.pl line 154. at deploy.pl line 154 main::DirCompare() called at deploy.pl line 243
If you have any input as to how I can better form the subroutine, please share your ideas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing files in directory
by Athanasius (Archbishop) on Dec 11, 2014 at 16:25 UTC | |
by smturner1 (Sexton) on Dec 11, 2014 at 19:30 UTC | |
by poj (Abbot) on Dec 11, 2014 at 20:42 UTC | |
by smturner1 (Sexton) on Dec 11, 2014 at 21:03 UTC | |
by poj (Abbot) on Dec 11, 2014 at 21:22 UTC | |
|
Re: Comparing files in directory
by toolic (Bishop) on Dec 11, 2014 at 15:55 UTC | |
|
Re: Comparing files in directory
by Anonymous Monk on Dec 11, 2014 at 15:52 UTC |