Get rid of line 9 (last;), and you'll get just that. (Update:) If you need to do something when it's not the first time, add an else:
while (<READ_FILE>) { if ($cur_code == $area_code) { //Some logic here } else { $cur_code = $area_code; if ($first_time == 1) { $first_time = 0; } else { //Some logic here } } print "Hello"; }
(I reformatted your code to a style with which I am more familiar so I could read it more easily. Don't take it personally.)
In reply to Re: Question about last statement
by ikegami
in thread Question about last statement
by perl_krish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |