Hello and welcome to the Webmasters Forums!. This is the best place to get webmasters resources for free. Get $2 for free today, read more - Make your payment today. Download premium and professional templates for free. Get free web hosting without ads, read more. You can get lot more by simply join with this forum. To gain full access to the forums you must sign up for a free account.
Posts: 995
Group: Forum Team
Joined: Sep 2006
Status: Online
Make money from now. You can make money just for posting on this forum. Every discussions on this community gives you more money. $2 minimum payout. So get your payment today, SignIn with this forum.
1. Testing "all-at-once" instead of incrementally, either bottom-up or top-down.
2. Optimistically skipping print scaffolding to dump values and show progress.
3. Not running with the perl -w switch to catch obvious typographical errors.
4. Leaving off $ or @ or % from the front of a variable, or omitting & when invoking a subroutine in Perl 4.
5. Forgetting the trailing semicolon.
6. Forgetting curly braces around a block.
7. Unbalanced (), {}, [], "", '', ``, and sometimes <>.
8. Mixing '' and "", or / and \.
9. Using == instead of eq, != instead of ne, = instead of ==, etc. ('White' == 'Black') and ($x = 5) evaluate as (0 == 0) and (5) and thus are true!
10. Using "else if" instead of "elsif".
11. Not chopping the output of backquotes `date` or not chopping input:
print "Enter y to proceed: ";
$ans = <STDIN>;
chop $ans;
if ($ans eq 'y') { print "You said y\n";}
else { print "You did not say 'y'\n";}
12. Putting a comma after the file handle in a print statement.
13. Forgetting that Perl array subscripts and string indexes normally start at 0, not 1.
14. Using $_, $1, or other side-effect variables, then modifying the code in a way that unknowingly affects or is affected by these.
15. Forgetting that regular expressions are greedy, seeking the longest match not the shortest match.
Hey, some of those aren't just newbie mistakes. I still occasionally make them years after first learning Perl. There is nothing more frustrating than having some weird error, and finding out that it was caused by some dumb typo somewhere in your program. That's why you always need to read your code carefully as you write it. Lately it seems too often that I will accidently type a ) instead of an }, and can't catch it easily because sometimes I'm not using a very large font in my editor.
Hey, some of those aren't just newbie mistakes. I still occasionally make them years after first learning Perl. There is nothing more frustrating than having some weird error, and finding out that it was caused by some dumb typo somewhere in your program. That's why you always need to read your code carefully as you write it. Lately it seems too often that I will accidentally type a ) instead of an }, and can't catch it easily because sometimes I'm not using a very large font in my editor.
I am mainly making mistakes on SQL commands. Once, I lost my entire day for finding an SQL error - The error was with the table name column (I used desc for description. A command DESC is used on SQL for sorting order.).
Also function argument passing and name declarations on different places makes me mad.