in reply to deleting a file in perl

G'day keralaqueen234,

Welcome to the monastery.

You showed a set of requirements in your initial post (files: currentlog.log, currentlog_2010.log and currentlog_2011.log). You didn't follow the advice given by hdb (using currentlog*.log instead of currentlog_*.log) and seemed surprised it didn't work. Further on, you changed your requirements showing a completely different set of filenames to match: "i have files with names currentlog.log,currentlog123.log,currentlog233.log,detail.txt,see.txt" [sic].

Any changes you make to requirements in your original posting (OP) should be clearly shown by adding an Update section to your OP. You should fix up your OP now.

This appears to be fast becoming an Off Topic thread with the problem being your lack of knowledge of your operating system rather than anything to do with Perl.

Assuming nothing else has changed between reading this thread and posting this response, it would appear that the pattern you want is: currentlog?*.log

$ ls -1 currentlog.log currentlog123.log currentlog233.log currentlog_2010.log currentlog_2011.log detail.txt see.txt $ ls -1 currentlog?*.log currentlog123.log currentlog233.log currentlog_2010.log currentlog_2011.log $ perl -E 'say for glob "currentlog?*.log"' currentlog123.log currentlog233.log currentlog_2010.log currentlog_2011.log

-- Ken