johnston wrote at Fri, 01 Aug 2003 14:15:18 +0800:

> My stupid question number one is:  When Perl processes the script, how 
> does it identify the lines of code?  ie.. If an error occurs at line 125, 
> is that the 125'th line of actual code, or does it count every single line 
> in the script from the beginning including remm'ed statements, blank lines 
> etc...??

Perl counts in most cases the lines like your editor does too. (Including
comments, heredocs and so on). Only evaled parts of your code get their
own counting, but I assume (hope) that beginners don't work often with
eval.

Sometimes the line is not what we humans might expect. E.g. if
if (...) {

} elsif { ... } {

}
has a runtime error or warning in the elsif condition part, Perl might
show the line nr of the if.

But compared to other languages, Perl is very correct finding the right
error or warning line.

> My reason for asking, is that with -w  I get "use of uninitiaized value 
> at..." errors which do not make much sense at the line numbers 
> mentioned...

Show us the code and the warning and we'll explain.


Greetings,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to