I am trying to read a file using perl script where the first column in the file is the date in format YYYY/MM/DD and I would like to compare each line in the file to the current date and only print the lines that matches the current date.
How do I compare first cloumn to the current system date.
#!/usr/bin/perl
package DateTime::Format::Multi;
use Time::localtime;
use Text::Wrap;
$w = 0;
open (FILE, "error") || die "couldn't open the file!";
while(<FILE>){
$line= $_;
if ($line =~ /1000-560-40-0/ && $line == (%04d/%02d/%02d))
{
print "$line\n";
$w++;
}
}
Thanks,
bataf