You don't say what is not working.
Anyway, here is a different way to do it:
@fields = ("A", "B", "C", "D", "E", "F");
$splitem = join '\s*(\S*)\s*', map quotemeta $_, @fields;
print $splitem;
for my $rec (@accounts) {
my @rowdata = $rec =~ /^$splitem\z/o or warn("misparsed $rec"), ne
+xt;
push @accounts_2, \@rowdata;
}
for ($j = 0; $j < @accounts_2; ++$j) {
for ($i = 0; $i < @{$accounts_2[$j]}; ++$i) {
print ("\$accounts_2[$j][$i] = $accounts_2[$j][$i]\n");
}
}
|