in reply to Re: Check for 'and'
in thread Check for 'and'

#!/usr/bin/perl use warnings; use strict; my $save; while (<DATA>) { if (/([^{TAG}]*)/) { $save = $1; print $save; } } __DATA__ {TAG} 0012310002 and 0012310003 {COUNT} 000000 {COUNT2} 000000 and 100001 {TAG} 2304854
How to print the value of only {TAG}. Now the output prints all the values like, 0012310002 and 0012310003
000000
000000 and 100001
2304854
So how to print only 0012310002 and 0012310003
and 2304854
which of {TAG} values