in reply to Perl : Split/Regex
Or just twisting the "if" statement of AppleFritter suggestion a bit like this:
there was no longer need for the bit // "" in the if statement. Just a timtoday!if($fields[-1] eq 'Y'){ ...
for my $result (@results) { my @fields = split /\s+/, $result; if ( $fields[-1] eq 'Y' ) { push @streams, $fields[0]; } else { push @spaces, $fields[0]; } }
|
|---|