I guess I am doing somehthing wrong, but I can't find what.

When compiling this code with Perl version 5.8.8:

$ cat Prueba3.pm BEGIN { unless (Parse::Eyapp::Driver->can('YYParse')) { eval q{ package Parse::Eyapp::Driver; require 5.006; #sub _DBLoad { 1; }; # End of string containing Parse::Eyapp::Driver }; # Unless Parse::Eyapp::Driver was loaded } ########### End of BEGIN
it gives me an error:
$ perl -c Prueba3.pm Missing right curly or square bracket at Prueba3.pm line 16, at end of + line (Might be a runaway multi-line {} string starting on line 3) syntax error at Prueba3.pm line 16, at EOF Prueba3.pm had compilation errors. $ perl -v This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
If I delete the comment there are no errors:
pl@nereida:/tmp$ diff Prueba3.pm Prueba.pm 9d8 < #sub _DBLoad { pl@nereida:/tmp$ perl -c Prueba.pm Prueba.pm syntax OK
Can someone help?

Thanks

Casiano

UPDATE:

I have got the same behavior when using Perl 5.10.0

casiano@beowulf:~$ perl -v This is perl, v5.10.0 built for i486-linux-gnu-thread-multi casiano@beowulf:~$ perl -c Prueba3.pm Missing right curly or square bracket at Prueba3.pm line 16, at end of line (Might be a runaway multi-line {} string starting on li +ne 3) syntax error at Prueba3.pm line 16, at EOF Prueba3.pm had compilation errors. casiano@beowulf:~$ perl -c Prueba.pm Prueba.pm syntax OK casiano@beowulf:~$ cat -n Prueba.pm 1 BEGIN { 2 unless (Parse::Eyapp::Driver->can('YYParse')) { 3 eval q{ 4 5 package Parse::Eyapp::Driver; 6 7 require 5.006; 8 9 10 1; 11 12 13 }; # End of string containing Parse::Eyapp::Driver 14 }; # Unless Parse::Eyapp::Driver was loaded 15 } ########### End of BEGIN casiano@beowulf:~$ cat -n Prueba3.pm 1 BEGIN { 2 unless (Parse::Eyapp::Driver->can('YYParse')) { 3 eval q{ 4 5 package Parse::Eyapp::Driver; 6 7 require 5.006; 8 9 #sub _DBLoad { 10 11 1; 12 13 14 }; # End of string containing Parse::Eyapp::Driver 15 }; # Unless Parse::Eyapp::Driver was loaded 16 } ########### End of BEGIN

Of course, the problem can be "solved" by inserting a false "}" inside a comment:

$ perl -c Prueba3trick.pm Prueba3trick.pm syntax OK pl@nereida:/tmp$ cat -n Prueba3trick.pm 1 BEGIN { 2 unless (Parse::Eyapp::Driver->can('YYParse')) { 3 eval q{ 4 5 package Parse::Eyapp::Driver; 6 7 require 5.006; 8 9 #sub _DBLoad { # False curly: } 10 11 1; 12 13 14 }; # End of string 15 }; # Unless Parse::Eyapp::Driver was loaded 16 } ########### End of BEGIN

In reply to Perl 5.8.8 bug? by casiano

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.