Dear Monks,

I am having a minor problem with a "Bad name After" error. I am using Strawberry Perl 5.12.1 on Windows XP. here is some dummy cope:
01: #!c:\Perl\bin\perl 02: use warnings; 03: use strict; 04: use CGI ':standard'; ED: use constant CONSTANT1 => '../perlscript1.pl'; ED: use constant CONSTANT2 => '../perlscript2.pl'; 05: my $htmlPage = CGI->new; 06: 07: print "\n<p>ID/&#65418;&#65439;&#65405;&#65436;&#65392;&#65412;&#6 +5438;&#12434;&#24536;&#12428;&#12383;&#26041;&#12399;"; 08: print $htmlPage->a( { -href => CONSTANT2 09: , -target => '_self' }, '&#12371;&#12385;&#12425;' ); 10: print "</p>\n<p>"; 11: print $htmlPage->a( { -href => CONSTANT1 12: , -target => '_self' }, '&#21033;&#29992;&#35215;&#32004;' + ); 13: print "</p>";


On Line 12 I get an error saying "Bad name after _self'". I have read that perl used to allow pkg'$var and this is still supported so I have tried:
12: , -target => ''_self'' }, '&#21033;&#29992;&#35215;&#32004 +;' ); 12: , -target => "_self" }, '&#21033;&#29992;&#35215;&#32004;' + ); 12: , -target => "'_self'" }, '&#21033;&#29992;&#35215;&#32004 +;' );
These other alternatives provide variations of the error. I am pretty certain also that it is not the Japanese characters causing the problem either, as I have tested the same characters in other places.

Now I say this is not a major problem as the code builds and runs fine, but I am still getting this error message and would like to understand why.

Thank you in advance for any help you can give.

Kind regards,
KyussRyn
P.S. The hashed codes are japanese characters.

****EDIT****
I am using Eclipse with EPIC, and the pages are coded into UTF-8 through the interface. I tried out the use utf8; line, and that created a recursion error. I have also retyped the troubled lines, copied it from Line 10, and used the same word as well, but to no avail.

In reply to Bad name after xxxx' by KyussRyn

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.