use warnings; use strict; my @retCodes_values; while (<DATA>) { next unless /retCode\=/; chomp; my ( $string, $exit_code ) = split /retCode\=/, $_, 2; push @retCodes_values, [ $string, $exit_code ]; } for my $aref (@retCodes_values) { if ($aref->[1] != 3) { print "@{ $aref }\n"; } } __DATA__ 15288 :: Mon Mar 2 13:23:32 2015::App.pm:status returned with retCode= +1 15288 :: Mon Mar 2 13:24:32 2015::App.pm:status returned with retCode= +3 15288 :: Mon Mar 2 13:25:32 2015::App.pm:status returned with retCode= +4 15288 :: Mon Mar 2 13:23:32 2015::App.pm:status returned with retCode= +5
Outputs:
15288 :: Mon Mar 2 13:23:32 2015::App.pm:status returned with 1 15288 :: Mon Mar 2 13:25:32 2015::App.pm:status returned with 4 15288 :: Mon Mar 2 13:23:32 2015::App.pm:status returned with 5
See also:
In reply to Re^3: Do not run code even if one element has matched exit code value
by toolic
in thread Do not run code even if one element has matched exit code value
by jayu_rao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |