in reply to Filtering rows with Parse::CSV
Off the top of my head and untested:
while (my $row = $parser->fetch()) { my $myColumn_value = $row->{'myColumn'}; print $myColumn_value unless($myColumn_value eq ""); }
if (and unless) can act as statement modifiers in Perl, so this will cause the print to be executed only if $myColumn_value isn't equal to the empty string.
You will get a warning here if it's undefined, BTW. If that's an issue, use
print $myColumn_value unless(($myColumn_value // "") eq "");
instead.
|
|---|