Baffled has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Carp; use vars qw(%config %category %form %super); require "/var/www/vhosts/mysite.com/cgi-bin/categories.cgi"; $config{'basepath'} = '/var/www/vhosts/mysite.com/cgi-bin/'; $config{'bluedir'} = 'register'; my $key; my $numusers = 1; opendir THEDIR, "$config{'basepath'}$config{'bluedir'}"; my @allfiles = grep -T, map "$config{'basepath'}$config{'bluedir'}/$_" +, readdir THEDIR; closedir THEDIR; $numusers = $numusers + @allfiles; my $totalfiles = 100; foreach $key (sort keys %category) { opendir THEDIR, "$config{'basepath'}$key"; my @allfiles = grep -T, map "$config{'basepath'}$key/$_", readdir THED +IR; closedir THEDIR; $totalfiles = $totalfiles + @allfiles; } #################################### print "Content-type: text/html\n\n"; #print "<center><font face=arial size=2><b>There are currently<font co +lor=FF0000> $numusers</font> registered users and<font color=FF0000> +$totalfiles</font><font color=000000> open auctions.</font></b></cent +er>\n"; print <<"EOF"; <div align=center> <center> <table border=0 cellpadding=0 cellspacing=0 width=100\%> <tr> <td width=100\% valign=middle align=center height=15></td> </tr> <tr> <td width=100\% valign=middle align=center height=20><font face= +Arial size=2><b>There are currently:</b></font></td> </tr> <tr> <td width=100\% valign=middle align=center height=15></td> </tr> <tr> <td width=100\% valign=middle align=center><img src=/images/user +s.gif> <font face=Arial size=2><b><font color=#FF0000>$nu +musers</font> registered users.</b></font></td> </tr> <tr> <td width=100\% valign=middle align=center height=0></td> </tr> <tr> <td width=100\% valign=middle align=center><img src=/images/auci +.gif> <font face=Arial size=2><b><font color=#FF0000>$tot +alfiles</font> open auctions.</b></font></td> </tr> <tr> <td width=100\% valign=middle align=center height=15></td> </tr> </table> </center> </div> EOF 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Poorly written script
by Thelonius (Priest) on Feb 11, 2008 at 05:17 UTC | |
by Baffled (Acolyte) on Feb 11, 2008 at 06:09 UTC | |
by Thelonius (Priest) on Feb 11, 2008 at 06:21 UTC | |
by Baffled (Acolyte) on Feb 11, 2008 at 06:34 UTC | |
by graff (Chancellor) on Feb 11, 2008 at 14:52 UTC | |
| |
by amarquis (Curate) on Feb 11, 2008 at 15:01 UTC | |
|
Re: Poorly written script
by andreas1234567 (Vicar) on Feb 11, 2008 at 07:26 UTC | |
|
Re: Poorly written script
by ysth (Canon) on Feb 11, 2008 at 04:34 UTC | |
|
Re: Poorly written script
by plobsing (Friar) on Feb 11, 2008 at 05:12 UTC |