in reply to Re: Re: Array in Array
in thread Array in Array

To my regret it is not working.
The script needs to use the array (@fields) (and not the  [A..F] ) as separator. I got empty results. :-(
It looked so simple in the beginning (when I started the script) but for a newbie it is not.
Thx,
Nylon

Replies are listed 'Best First'.
Re: Re: Re: Re: Array in Array
by Anonymous Monk on Oct 07, 2003 at 11:18 UTC
    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"); } }