in reply to Re^3: Ignore a range of numbers ina List
in thread Ignore a range of numbers ina List
Note that you probably don't need to test $flag in the statements where you change its value. For example the loop of your first solution could be simplified as follows:
for (@$aref) { $flag = 1 if $_== 6; push @new, $_ unless $flag; $flag = 0 if $_== 7; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Ignore a range of numbers ina List
by AnomalousMonk (Archbishop) on Jun 25, 2017 at 16:47 UTC | |
Re^5: Ignore a range of numbers ina List
by anonymized user 468275 (Curate) on Jun 25, 2017 at 14:01 UTC |