in reply to Re^4: Seek and Find
in thread Seek and Find
Obvious errors you should be aware of:
Checking for equality is == for numeric equivalence and eq for string-wise equivalence. See Equality Operators in perlop.
In general, conditional clauses and lists need to be in parentheses. See Compound Statements in perlsyn.
Control structures require blocks wrapped in curly brackets. Again, See Compound Statements in perlsyn.
You use the default variable a lot without actually using its features. That's a recipe for disaster. See $_ in perlvar.
Arrays are indexed starting at 0, not 1.
$line[6] != ['Asterisk' 'Colon'] (in addition to missing a comma) really doesn't do what you think. You need to check equality twice with an or statement, and even then you need stringwise equivalence with ne, not numeric equivalence.
Where did you come up with this syntax? What is your programming background? I do not mean to be disrespectful.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Seek and Find
by hbrown.bios (Initiate) on Feb 08, 2016 at 22:37 UTC |