|
| Author |
Message |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 08, 2005 8:31 pm Post subject: Error Forum |
|
|
| What about a forum for errors with bots? It would help filter out the question boards. |
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
Posted: Fri Jul 08, 2005 8:33 pm Post subject: |
|
|
| Reading the errors, debugging yourself, and understanding perl would do the same. |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 08, 2005 8:37 pm Post subject: |
|
|
| Hey, I'm under the impression that you believe I don't try before posting. I put a good amount of time into it (probably more than you do). It isn't my fault that my attempts at fixing it aren't correct. I'm trying the best that I can. |
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
Posted: Fri Jul 08, 2005 8:44 pm Post subject: |
|
|
The problem is you show no attempts you just post the errors and say fix it. The errors tell you almost in word for word whats wrong and what line.
you should isolate your problem...take the line with the error and make it a new file and test whats giving you the problem....you should never post 400 lines of code and even more errors
Lol and i really don't think you put more time into it then me. I would be shocked to find anyone other than cer, eric or mojave who has. |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 08, 2005 8:50 pm Post subject: |
|
|
| It's just so frusterating. Spending the few hours of time I have trying to change what it says in the error, only to get it to say pretty much the same error just saying it is near something else. And if I knew how to fix the errors any other way I would. I even tried downloading a perl notepad to fix the error. So don't you dare say I didn't try |
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
Posted: Fri Jul 08, 2005 8:53 pm Post subject: |
|
|
Dry those tears , im not saying you didnt try im just saying you should isolate your errors and that i disagree with that type of forum. If this is too hard for you maybe you should look into some perl tutorials first to better understand it and the types of errors. |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 08, 2005 9:05 pm Post subject: |
|
|
| I usually try to post just the areas needed, but in this case, there are about fifty errors. So it is kind of hard to just post a small area |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Fri Jul 08, 2005 10:31 pm Post subject: |
|
|
If it's of any help, I'll share what I do when I get errors:
In my coding, I leave blank lines between different parts of the code. i.e. when it goes to open a file, get the contents, chomp, etc. - all those go right side-by-side, then I'd leave a blank line before continuing.
For example:
| Code: | # Opening file, retrieving data
open (FILE, "./file.txt");
my @data = <FILE>;
close (FILE);
chomp @data;
# creating new array
my @final = ();
# Beginning foreach loop, formatting
# initial data from each line.
foreach my $line (@data) {
my ($what,$is) = split(/=/, $line, 2);
$what = lc($what);
$what =~ s/ //g;
# Comparing things.
if ($what eq $variable) {
$line = "$variable=$value"
}
# Adding to array.
push (@final, $line);
}
# write new file
open (NEW, ">./file.txt");
print NEW join ("\n", @final);
close (NEW); |
So let's say I get a syntax error somewhere inside the foreach loop. I take a block of code out at a time, and try running the code again. If I get the error still, I put that block back in and take out a bigger block.
For example, I might take this out first:
| Code: | # Adding to array.
push (@final, $line); |
Doesn't solve the problem, so I go up a few lines and take out all of this:
| Code: | my ($what,$is) = split(/=/, $line, 2);
$what = lc($what);
$what =~ s/ //g;
# Comparing things.
if ($what eq $variable) {
$line = "$variable=$value"
}
# Adding to array.
push (@final, $line); |
And now the error isn't there anymore. So I know that the problem is within that block of code. I can put the whole block back in and begin taking out different blocks and trying again.
This way I can slowly narrow it down to exactly which block of code is causing the problem. I can then examine it closely and find that I forgot a semicolon at the end of the line:
| Code: | | $line = "$variable=$value" # right there |
Hope that's of help.  _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
purcelly God Like

Joined: 10 Jun 2004 Posts: 560 Location: North West, England
    
|
Posted: Sat Jul 09, 2005 2:03 pm Post subject: |
|
|
i dont think matt was saying that you don't try its just in your post there is no evidence of you trying;
i.e i tried this (code) but i still get this error (error)
and very handy cer |
|
| Back to top |
|
 |
|