L
laszlo
I have an interactive perl cgi programlet, which allows some graphics
for interactively typed and executed perl programs:
http://lzkiss.netfirms.com/cgi-bin/igperl/igp.pl?name=test
Until I used perl 5.6 the programlet below didn't gave any error
message for the "while (true) {" statement. In my localhost I updated
to ActiveState 5.8.0 version, and the bareword true causes an error in
while. However the associated line number is not the real line number,
but the last line of the sub, so line 9 instead of the actual line
number of the error. If I modify the program to e.g. "while (true ==
1) " there is an error with the proper line number. Apparently the
program precompiles the condition in the sub and reports the error as
it would be at the last line of the sub.
Is there anything I can do to get the correct error number (I list $@
after calling eval for the programlet; the head with use statements is
called outside the eval function)
use warnings;
use strict "subs";
use strict "refs";
$a = 1;
sub alma {
while (true) {
$a = 2;
}
}
true;
Bareword "true" not allowed while "strict subs" in use in test.func
line 9
(You don't see this error on the above webpage because the public
server is using 5.6)
for interactively typed and executed perl programs:
http://lzkiss.netfirms.com/cgi-bin/igperl/igp.pl?name=test
Until I used perl 5.6 the programlet below didn't gave any error
message for the "while (true) {" statement. In my localhost I updated
to ActiveState 5.8.0 version, and the bareword true causes an error in
while. However the associated line number is not the real line number,
but the last line of the sub, so line 9 instead of the actual line
number of the error. If I modify the program to e.g. "while (true ==
1) " there is an error with the proper line number. Apparently the
program precompiles the condition in the sub and reports the error as
it would be at the last line of the sub.
Is there anything I can do to get the correct error number (I list $@
after calling eval for the programlet; the head with use statements is
called outside the eval function)
use warnings;
use strict "subs";
use strict "refs";
$a = 1;
sub alma {
while (true) {
$a = 2;
}
}
true;
Bareword "true" not allowed while "strict subs" in use in test.func
line 9
(You don't see this error on the above webpage because the public
server is using 5.6)