use strict; use warnings; use File::Copy "mv"; use Data::Dumper; no strict 'refs'; my @names; my $file; my $name; my $regex = 'WARNING'; #Variable to hold path to the log directory my $dir = "H:/vpn/"; my $out = "H:/vpn/vpnwarn.out"; my $old = "H:/vpn/vpnwarn.old"; if (-s $out) { mv ($out, $old)"; unlink ($out)"; }