By changing the regular expression (perlretut):

if ($item =~ /_0828900840_.*D602BG/)

Or, by using a different glob pattern (Update: However, choroba makes a good point about glob, and I should note that I don't usually use it because of several caveats):

my @contents = <$folder/*_0828900840_*D602BG>;

Or by using a module like File::Find::Rule:

use File::Find::Rule qw/rule/; my @files = rule->file->name(qr/_0828900840_.*D602BG/) ->maxdepth(1)->in(@folders);

Update: Upon further consideration, I'm withdrawing my suggestion for glob. As soon as $folder contains whitespace, such as a forgotten chomp, it will break in strange ways. Update 2: It's possible to say use File::Glob ':bsd_glob'; to fix that issue, but my position is still "use glob only if you've read all of its documentation, including File::Glob".


In reply to Re: Pick up specific file name (updated) by haukex
in thread Pick up specific file name by JobyJ

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.