On Mon, Jun 23, 2014 at 2:42 AM, Uday Vernekar <[email protected]> wrote:
> Hi All,
>
>
> I have following Pattern from which I need to grep only the Fail count and
> store that in a variable.
>
> U/A/S|Test| Test |Loop | Run |Pass |Fail |
> Arguments
> | Name |Count|Count|Count|Count |
> -----+----+---------------------------+-----+-----+-----+-----+--------------+---------------
> | 72| Traffic Test | 1| 11| 11| 0|
> (none)
>
> based on fail count value need to print
>
> if 0------Sucess
> if >0------Fail
>
Another way:
while ( <DATA>) {
...
my $fail_count - ( split( /\|/, $_ ) )[-2];
...
}
See: perldoc -f split
--
Charles DeRykus
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/