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...
In reply to Re^3: deleting a file in perl
by hdb
in thread deleting a file in perl
by keralaqueen234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |