in reply to Resizing MRTG (RRDTool) logs en-masse
my @rrds = grep { /.*rrd$/ && -f "$logsdir/$_" } readdir DIR;
Why match zero or more characters in /.*rrd$/ when /rrd$/ would match the same thing with less work? Perhaps you meant /\.rrd$/?
$cmd = qq|$mv resize.rrd $logsdir/$rrd|; print "\tRenaming resized file, executing $cmd\n"; system($cmd) == 0 or die "Could not execute $cmd:$!\n";
Why not just use Perl's built-in rename function?
print "\tRenaming resized file, executing $cmd\n"; rename 'resize.rrd', "$logsdir/$rrd" or die "Could not rename +resize.rrd:$!\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Resizing MRTG (RRDTool) logs en-masse
by McDarren (Abbot) on Nov 30, 2010 at 01:33 UTC | |
by jwkrahn (Abbot) on Nov 30, 2010 at 02:23 UTC | |
by McDarren (Abbot) on Nov 30, 2010 at 04:03 UTC |
In Section
Cool Uses for Perl