in reply to fast way of working with numerical positions
Then once you've loaded all lines into the array, you can grab the point data and loop through them. You can store the points into an array and since it's just a number, just store it as is (no need to turn it into a string). For each point you'll want to do something like this$string = "$a,$b"; push(@array, $string);
foreach my $value (@array) { my($a,$b) = split(/,/, $value); if($x >= $a && $x <= $b) { print "This point is on the line"; } }
|
|---|