in reply to Question about last statement
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.)
|
|---|