Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: Array in Array

by nylon (Acolyte)
on Oct 07, 2003 at 08:56 UTC ( [id://297230]=note: print w/replies, xml ) Need Help??


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"); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://297230]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-19 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found