frenchface has asked for the wisdom of the Perl Monks concerning the following question:
Here is my code.0:00 1:00 2:00 3:00 ... 23:00 data from text files here data from text files here data from text files here data from text files here
#!/usr/bin/perl use strict; use warnings; use CGI ':standard'; print header, start_html('Player Point Tracker'), h1('W51 Point Tracker'), start_form, body('The website is also case sensitive and may take awhile to se +arch, It will be looking though alot of data.'), p, 'Players Name: ', textfield('name'), br, submit('Search!'), end_form, p, hr; my $search_term =param('name'); print "$search_term", p; for my $digit (0 .. 9) { for my $file (<$digit*>) { open (my $FILE_HANDLE, '<', $file) || die "Can't open $file: $ +! \n"; while (<$FILE_HANDLE>) { chomp; my ($word, $count) = split / /, $_; if ($word =~ /^$search_term$/) { print "At $file $word had $count points.", p; #print "$file"; } } close ($FILE_HANDLE); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cgi table
by hesco (Deacon) on Sep 25, 2010 at 04:54 UTC | |
|
Re: cgi table
by marto (Cardinal) on Sep 25, 2010 at 08:04 UTC | |
|
Re: cgi table
by roboticus (Chancellor) on Sep 25, 2010 at 02:23 UTC | |
by frenchface (Initiate) on Sep 25, 2010 at 16:10 UTC | |
by roboticus (Chancellor) on Sep 25, 2010 at 17:02 UTC | |
by frenchface (Initiate) on Sep 25, 2010 at 17:33 UTC | |
by roboticus (Chancellor) on Sep 25, 2010 at 19:20 UTC | |
|