jjmoka has asked for the wisdom of the Perl Monks concerning the following question:
So #line is fixed to 1. That $line, as it is, is joined with other stuff to build an $eval (in the same file, method: sub convert_script_to_compiled_handler { ( code ):ModPerl::RegistryCooker::get_mark_line () sub get_mark_line { my $self = shift; $ModPerl::Registry::MarkLine ? "\n#line 1 $self->{FILENAME}\n" : " +"; }
Anyhow it doesn't (always) work. With Apache::DB (the Perl debugger under mod_perl), The value 1 NEVER works on the FIRST file which is loaded. But it works magically if I step into another file, and still doesn't work when I return back in the first file. After this hint which suggested to write the 'next' line, I found that in my case it worked changing the value from 1 to 3 (2nd line was the shebang and 2 didn't work either). But in other cases, where the first loaded file is different I didn't find any working value. Usually I focus on MY code, to start searching where the problem is. Here I'm wondering what's wrong. Any idea or previous experience on this, are both welcome.my $eval = join '', 'package ', $self->{PACKAGE}, ";", "sub handler {", "local \$0 = '$script_name';", $nph, $shebang, $line, <------------------------------ ${ $self->{CODE} }, "\n}";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: right usage of #line ??
by LanX (Saint) on Sep 09, 2015 at 00:38 UTC | |
by jjmoka (Beadle) on Sep 10, 2015 at 07:19 UTC | |
by jjmoka (Beadle) on Sep 14, 2015 at 19:47 UTC | |
|
Re: right usage of #line ??
by Anonymous Monk on Sep 07, 2015 at 22:38 UTC | |
by Anonymous Monk on Sep 08, 2015 at 07:35 UTC |