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


In reply to Re: deleting a file in perl by kcott
in thread deleting a file in perl by keralaqueen234

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.