By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

How to find file pattern in a directory

P: 4
Thank you in advance.

File pattern - "BB".$today_date.*.dat
Files Eg: -
BB.201000526.0000.dat BB.201000526.0001.dat
BB.201000527.0000.dat BB.201000527.0001.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>.<file_pattern> )
May 27 '10 #1
Share this Question
Share on Google+
1 Reply


Expert
P: 70
Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3.  
  4. my $today_date = '20100527';
  5. my @files = glob "BB.$today_date.*.dat";
  6.  
May 27 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.