in reply to ForEach Command struggle..
Hey Kage we spoke yesterday on the Chatterbox, and I downloaded and attempted to debug your code. first off there are several statements like this:
${$locationold}{online}++;
doesn't $locationold contain a url string? Why are we dereferencing it? I'm really confused by this. If you're not an expert perl programmer, I think you are overcomplicating things.
also you need to read the perlopentut man page. In this script you try to open variables that haven't been initialized that can clobber you script, and your opens should really be followed by an or die() for this reason. The param function from CGI.pm is defined but never used... You use the same filehandle over and over through different opens, which is a Bad Thing.
Anyway, I applaud your effort, but I suggest in the future, when posting here, you add comments to your script before every major block explaining what you want to do. Indent your loops, and explain what errors the interpreter gave you. There are a lot of people on this site, who are much better programmers than me, and very helpful people to boot, but neither they nor i can help much if we cant understand what you are trying to do.
Fun fact:
is better written as:foreach $loctitle (@titleb){ $online++; }
|
---|