Why are the error messages different?
I have two programs:
#line 1 "DB::eval"
234asd
perl < tmp.pl
Bareword found where operator expected at DB::eval line 1, near "234asd"
(Missing operator before asd?)
syntax error at DB::eval line 2, near "234asd
"
Execution of - aborted due to compilation errors.
and the second one:
$str = <<CODE;
#line 1 "DB::eval"
234asd
CODE
eval $str;
print $@;
perl < tmp.pl
Bareword found where operator expected at DB::eval line 1, near "#line 1 "DB::eval"
234asd"
(Missing operator before asd?)
syntax error at DB::eval line 2, near "#line 1 "DB::eval"
234asd
"
Why, in the second case, I got additional text in the error message #line 1 "DB::eval"
:? I don't expect this.
Also in the second case I am not expecting an extra newline. I am waiting:
234asd "
Instead:
234asd "
+3
source to share