Hi,
May I know how to check for empty file in Perl.
Iam missing something, somewhere.
#!/usr/bin/perl
my $open_dir = '/path/';
my $file;
my $ma = "abc_.*.\.psv\$"
opendir(VAR, $open_dir) or die "Can't open $oepn_dir: $!\n";
while\( defined \($file = readdir VAR\) \) \#read all the files in the directory
\{
if \(\($file =~ /$ma/i\) && \( -s $file \)\) \{
print $file;
\}
\}
It doest work.
I doesnt give out any non empty file. pls correct me.