On Mon, Jun 23, 2014 at 2:42 AM, Uday Vernekar <vernekaru...@gmail.com> 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: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/