How to find file pattern in a directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathew1
    New Member
    • Jan 2010
    • 4

    How to find file pattern in a directory

    Thank you in advance.

    File pattern - "BB".$today_dat e.*.dat
    Files Eg: -
    BB.201000526.00 00.dat BB.201000526.00 01.dat
    BB.201000527.00 00.dat BB.201000527.00 01.dat

    How can I find above pattern of files in a directoy.
    The "*" used in the above pattern is correct?
    Would be preferred if you can use with if ( -e $<directory>.<f ile_pattern> )
  • toolic
    Recognized Expert New Member
    • Sep 2009
    • 70

    #2
    Code:
    use strict;
    use warnings;
    
    my $today_date = '20100527';
    my @files = glob "BB.$today_date.*.dat";

    Comment

    Working...