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/パスワート
+5438;を忘れた方は";
08: print $htmlPage->a( { -href => CONSTANT2
09: , -target => '_self' }, 'こちら' );
10: print "</p>\n<p>";
11: print $htmlPage->a( { -href => CONSTANT1
12: , -target => '_self' }, '利用規約'
+ );
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'' }, '利用規約
+;' );
12: , -target => "_self" }, '利用規約'
+ );
12: , -target => "'_self'" }, '利用規約
+;' );
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.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.