in reply to Re^2: deleting a file in perl
in thread deleting a file in perl
currentlog.log fits the pattern currentlog*.log. The "_" makes the difference. If you need something more general than "currentlog_*.log" try this:
my @logs = glob "currentlog*.log"; for (@logs) { next if $_ eq "currentlog.log"; unlink $_; }
I hope you have copies of your logfiles before do any testing...
|
|---|