CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [hwnd] Reading results back that were dumped?: Edit Log



Chris Charley
User

Apr 11, 2013, 3:31 PM


Views: 970
Re: [hwnd] Reading results back that were dumped?

To limit results to 5 at a time, maybe something like below.

Code
  my @data;   
for my $key (keys %hash) {
if (@data == 5) {
... do something with @data
@data = ();
}
else {
push @data, $key;
}
}

... do something with remainder of @data

To get the column names, I think you would have to store them, like you did with your hash.

my @cols = qw/ newsid newsdate newshead /;
and
nstore( \@cols, 'colnames') unless (-e 'colnames');
my $cols= retrieve( 'colnames');


(This post was edited by Chris Charley on Apr 11, 2013, 3:59 PM)


Edit Log:
Post edited by Chris Charley (User) on Apr 11, 2013, 3:47 PM
Post edited by Chris Charley (User) on Apr 11, 2013, 3:59 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives