Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: generating a large list of names to be displayed neatly in HTML

by TedPride (Priest)
on Sep 02, 2006 at 22:30 UTC ( [id://570894]=note: print w/replies, xml ) Need Help??


in reply to generating a large list of names to be displayed neatly in HTML

A raw list in alphabetic order is probably fine. They can use the find function on their browser to locate things from there. However, if you -really- want a list that you can jump around in by letter:
use strict; use warnings; my (@names, $f, %names); chomp (@names = <DATA>); for (@names) { $f = substr($_, 0, 1); push @{$names{$f}}, $_; } print join ', ', map { "<a href=\"#$_\">$_</a>" } sort keys %names; print "<p>\n\n"; for (sort keys %names) { print "<a name=\"$_\"></a><b>$_</b>\n<ul>"; print join "\n", map { "<li>$_" } sort @{$names{$_}}; print "</ul><p>\n\n"; } __DATA__ Alvin Clarissa Kappa Bob Bubba Zim
There's probably a CSS way to make it so just pressing a key on the keyboard jumps to that letter, but I'm not going to complicate things.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-29 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found