Using Perl 5.6.1 on HP-UX.

I need to test for the existence of a file every day. The filename
changes each day because the filename contains a data and time stamp. 
For example, today's filename is KeyLinks_082903_120712.csv. So I would
like to test for KeyLinks*.csv

My code is as follows:

-----

  $file = "$DATA_HOME/KeyLinks\*.csv";
  print $file;
  print "\n";

  if (-e $file) {
     print "File Keylinks*.csv exists!\n";
  } else {
     print "File Keylinks*.csv not understood!\n";
  }

For output, I get:

---
/warehouse/data/KeyLinks*.csv
File Keylinks.csv not understood!
----

It expands the filename and prints it out just fine, but the -e test
fails. Why is that? I have reviewed several reference books and they all
show examples of using the -e test. It mustn't be evaluating the splat
correctly.

Thanks,

Kevin Struckhoff
Data Warehouse Consultant
Yamaha Motors U.S.
[EMAIL PROTECTED]
714-761-7310


Reply via email to