A friend asked me to throw something together for him to help him control a roster. The problem is, while what I wrote works on my server, it doesn't work on his. Now here's the real kicker though... when I cleared out one of my old files I'd gave him (old test proggie) that did work, and pasted in the code from my new program, it worked.
I've looked at the code carefuly, and it is identical... I also double checked the chmod and the path to perl, both of those are identical... so the question is... what could make this work with one file, and not with the other?
#!/usr/bin/perl use Storable; #use CGI qw(:standard); use strict; use constant ROSTER => '/storage/roster.dat'; print "Content-Type: text/html; charset=ISO-8859-1\n\n"; #print header; my $data; if(-e ROSTER){ $data = retrieve(ROSTER); } #You can edit here #Note: Do not use the character ~ when editing without contacting some +one with perl experience print qq~<html> <head> <title>Moonglow Town Council of Atlantic - a Guild, Organization, and +People</title> <style type="text/css"> BODY{ scrollbar-base-color:#39428D; scrollbar-track-color:#39428D; scrollbar-arrow-color:#FFFFFF; scrollbar-highlight-color:#262659; } </style> </head> <body bgcolor=black link=white alink=white vlink=white text=white back +ground="http://www.greypawn.com/MTC/images/content_02.jpg" bgproperti +es=fixed> <font face=Arial size=2 color=white> <span style="font-size:12pt;filter:Shadow(color=#000000,direction=135) +;padding:5;width:100%;"> <h2>Member Roster</h2> <font color=white size=2 face=Verdana><b> <br> <center> <table cellspacing=0 cellpadding=0 border=0 width=500> <tr> <td><font face=Arial size=2 color=white><b><div align=left>Na +me:</td> <td><font face=Arial size=2 color=white><b><div align=left>Ti +tle:</td> <td><font face=Arial size=2 color=white><b><div align=left>IC +Q:</td> </tr>~; #NO MORE EDITING WITHOUT SUPERVISION #Data format: # Hash of names # - icq # - title if($data){ my @list = sort({ $a cmp $b } keys(%{ $data })); foreach my $name (@list){ my $icq = $data->{$name}{'icq'}; my $title = $data->{$name}{'title'}; print qq~ <tr> <td><font face=Arial size=2 color=white><b><div align=left>$n +ame</td> <td><font face=Arial size=2 color=white><b><div align=left>$t +itle</td> <td><font face=Arial size=2 color=white><b><div align=left>$i +cq</td> </tr>~; } }else{ print qq~<tr><td align="middle"><font face="Arial" size=3 color=red +><b>Error: Unable to scan required data!</b></font></td></tr>~; } print qq~</table> </center> <br><br> </font> </span> </body> </html>~;
Note: I realize this code is highly unprofessional, I literally threw it together since I wanted this project done quickly... It is *not* up to my usual requirements. The HTML is also not my fault as it was copy-pasted from a template my friend had.
If you think I overlooked anything, feel free to ask.
My code doesn't have bugs, it just develops random features.
In reply to Identical files, only one works? by Flame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |