Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Finishing Touches

by nashdj (Friar)
on Apr 01, 2001 at 11:34 UTC ( #68808=note: print w/replies, xml ) Need Help??


in reply to Finishing Touches

Well sorting alphabetically is easy, even a simple search on perlmonks can tell you how to do that. I can even give you the node: How do I sort something alphabetically?

For your result grouping, if you always load the entire file into an array on each page load you can simply do something like
my $start = (get starting number from your input); for ($start..$start+10) { (do things with $array[$_]); }
You'll have to set it up so that the first time the results are displayed it starts with 0. Then on each page load set the next 10 and previous 10 links to pass paramaters back to be used in $start as $start + 10; or $start - 10;

Oh, also you'll probably want to throw something in to break out of the loop if $_ becomes greater than the size of the array.

I havent really answered your question explicitly, as I got the idea that you just wanted a start, and would sort out the gory stuff yourself :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://68808]
help
Chatterbox?
[Corion]: ambrus: Yeah, at least that's what I think I'll start with. A timer and potentially the dummy IO function that never is ready
[ambrus]: That only lets you invoke the main loop from Prima->run;, not from AnyEvent->condvar- >recv; but that shouldn't matter
[Corion]: ambrus: Details ;)
[ambrus]: Like <c>{ package AnyEvent::Impl:: Prima; use Prima; sub io{ my($s,%r)=@_; Prima::File->new( file=>$r{fh},mask =>("w"eq$r{poll}? fe::Write():fe:: Read())|fe:: Exception,onRead =>$r{cb},onWrite =>$r{cb}, onException=>$r{cb }) } sub timer { ... } push @AnyEvent::REGI
[ambrus]: argh, too long, let me try on scratchpad

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2016-12-08 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.