Always use strict; use warnings; it would tell you what's wrong.
There are two problems with your code. The first is that compare strings with ==, even though that operator does numeric comparison. And the second is that if there are only two chunks in the original string, $split_data[2] will not be the empty string, but undef.
So your test should look more like
if (!defined($split_data[2]) || $split_data[2] eq '0') { print $split_data[1], "\n"; }
In reply to Re: extracting data
by moritz
in thread extracting data
by prassi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |