Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Array of arrays

by jdporter (Paladin)
on Feb 21, 2006 at 18:41 UTC ( [id://531763]=note: print w/replies, xml ) Need Help??


in reply to Array of arrays

Well that could be an expensive proposition. If you can live with the memory cost, something like the following will work. In this version, I'm presuming that the "collection of rows" starts out empty, and that you don't need it for anything other than to determine whether a row has been seen before or not. If that presumption is false, let me know and I can enhance it accordingly.

my %seen; my @row; while ( @row = $sth_C->fetchrow_array ) { my $krow = join "\0", @row; $seen{$krow}++ and next; # or did you mean last? print OUTPUT_FILE join( "\t", @row ), "\n"; undef @row; }
We're building the house of the future together.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-29 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found