in reply to Re^4: Performance optimization question
in thread Performance optimization question

After all examples given by all of you I decided that the best way for me to improve my performance is
1) to use regex for forming array
2) regex should be as simple as possible which can be done by adjusting it to my particular case

So could you confirm that it will always work correctly:
my string is always like
143,2|3674,9|12,5|......|145,9
so in |X,Y| Y is always single digit
and I want to have an array of pairs
@arr = (X1,Y1)(X2,Y2)... Then the simplest way is:
$r = 9; # or any single number my @arr = $string =~ /([^,|]+\,$r)/g;
It actually works but am I right?