use Modern::Perl; open(my $data, '<', $file_c) or die "Could not open '$file_c' $!"; say 'Empty file' if 1 == scalar grep {/[^\s,]/} <$data>;