in reply to splitting lines a number of times

There is definitely no need for all of those splits. If you want an array that contains all numbers, e.g. you want to replace a single array element "(0,670)" with two array elements one for each number. You could do the following:

use strict; use warnings; while (my $line = <DATA>) { #remove all whitespace $line =~ s/\s//g; #split line my @aFields = split(/;/, $line); #remove parenthesised field my $sFld1 = shift @aFields; #convert parenthesized field to numbers my ($sNoParens) = ($sFld1 =~ /^\(([^)]*)\)$/); my @aSubFields = split(/,/, $sNoParens); # if you want to make sure there are only N # numbers, do your checks here. #put the numbers where fld0 was originally unshift @aFields, @aSubFields; #print the result print "<@aFields>\n"; } __DATA__ ( 0, 670); 3.2; 7.8; 9.4; 10.2; 12.6;

See shift and unshift for more information.

Best, beth