Rob McGinness wrote:
>
> Thanks Rob Dixon and John W. Krahn for your help I really appreciate
> it. This is what I came up with based on your examples and the code
> works great. Thanks again.
>
>
> #!/usr/bin/perl
Always
use strict;
use warnings;
at the start of your program. That way many simple problems will be revealed by
Perl itself.
> my $dir = "/cert/ImpactServer-5_4/cl9/ctrl_sfm9/sfm9_sched/archives/";
>
> my $dh = opendir DIR, ".";
This opendir is superfluous. If you had enabled warnings it would have told you
Name "main::DIR" used only once: possible typo
> my @files = do {
>
> opendir my $dh, $dir or die "Cannot open '$dir' $!";
>
> grep /^Completed\.archive\.\d{1,4}$/
>
> && -M "$dir/$_" > 7, readdir $dh; };
You should remove the slash either from the end of your definition of $dir at
the top or from the string "$dir/$_". I would prefer the former.
> foreach (@files) {
>
>
>
> system ("compress -v "."$dir".$_);
Those concatenation operators are unnecessary, and you should test the result of
the call to system
system ("compress -v $dir$_") == 0 or die $?;
> # print "$_\n";
>
>
>
> };
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/