Sudhindra K S wrote:
I have an output which looks like this:

Do you possibly mean input? ;-)

Tag       : Result
148200    :
148312    : 38160
148329    : 44139
148444    : NONE
148514    :
148573    : 0000
148697    :

<similar lines snipped>

Now i want to gather all the "Tags" for which the "Result" is a
number (but shouldnt include the tag if the result is 0). The
corresponding Result should go to another array.

Considering the above example my array1 should contain 148312 and
148329 and array2 should contain 38160 and 44139

How do i do this?

while (<DATA>) { my ($tag, $result) = split /[ :]+/; if ($result =~ /^\d+$/ and $result > 0) { ...

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl




-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to