Rob McGinness wrote:
> I always forget the use strict, use warnings.  Thanks again.  
> 
> #!/usr/bin/perl
> use strict;
> use warnings;
> my $dir = "/cert/ImpactServer-5_4/cl9/ctrl_sfm9/sfm9_sched/";
> my $dh = ".";

Now you have a different spare line :)

> my @files = do {
>         opendir my $dh, $dir or die "Cannot open '$dir' $!";
>         grep /^Completed\.archive\.\d{1,4}$/
>         && -M "$dir"."$_" > 2, readdir $dh; };
> foreach (@files) {
>         system ("compress -v $dir$_") == 0 or die $?;
> #       print "$_\n";
> };

This is my version.

Rob


use strict;
use warnings;

my $dir = "/cert/ImpactServer-5_4/cl9/ctrl_sfm9/sfm9_sched/";

my @files = do {
  opendir my $dh, $dir or die "Cannot open '$dir' $!";
  grep /^Completed\.archive\.\d{1,4}$/ && -M > 2,
  map "$dir$_",
  readdir $dh;
};

foreach (@files) {
  system("compress -v $_") == 0 or die $?;
  #print "$_\n";
};

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to