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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.