[BUG] line numbering off-by-one with Apache::DB and RegistryCooker

[prev] [thread] [next] [Date index for 2005/03/14]

From: Dominique Quatravaux
Subject: [BUG] line numbering off-by-one with Apache::DB and RegistryCooker
Date: 15:12 on 14 Mar 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Because ModPerl::RegistryCooker->rewrite_shebang() adds a line on top
of the file in order to honor e.g. the "-w" in "#!/usr/bin/perl -w",
the debugger loses count.

The (trivial) patch below against SVN trunk fixes that (the "use
warnings; " statement now gets added on the same line).

And yes, it means that I succeeded in running Apache::DB with mod_perl
2, even without -X! (It was just a stupid mistake on my part, actually
Apache::DB works like a charm out-of-the-box with a preforked,
multiprocess Apache).

===================================================================
- --- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (revision 157426)
+++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (working copy)
@@ -556,7 +556,9 @@
~ # func: rewrite_shebang
~ # dflt: rewrite_shebang
~ # desc: parse the shebang line and convert command line switches
- -#       (defined in %switches) into a perl code.
+#       (defined in %switches) into a perl code. This routine must
+#       not shange the number of lines in the script, lest the #line
+#       statement be off-by-one in convert_script_to_compiled_handler().
~ # args: $self - registry blessed object
~ # rtrn: nothing
~ # efct: the CODE field gets adjusted
@@ -569,7 +571,7 @@
~              unless ${^TAINT};
~        "";
~    },
- -   'w' => sub { "use warnings;\n" },
+   'w' => sub { "use warnings; " },
~ );

~ sub rewrite_shebang {

- --
Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCNanCMJAKAU3mjcsRAkRkAKCTJTdaS4zlHEX28fjDLmJaUwFygQCfeB4F
k3Sew3r3ne1iHfwxt7/YFhk=
=2YHl
-----END PGP SIGNATURE-----


(message missing)

[BUG] line numbering off-by-one with Apache::DB and RegistryCooker
Dominique Quatravaux 15:12 on 14 Mar 2005

Generated at 16:59 on 18 Mar 2005 by mariachi v0.52