Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Getting error when declaring utf8 variable as lexical

by MrNobo1024 (Hermit)
on Aug 10, 2002 at 18:38 UTC ( #189214=perlquestion: print w/ replies, xml ) Need Help??
MrNobo1024 has asked for the wisdom of the Perl Monks concerning the following question:

This program
use utf8; my $Ā = 5; print $Ā;
gets this error:
"my" variable $strict::VERSION can't be in a package at C:/perl/lib/st +rict.pm line 93, near "$strict::VERSION " Compilation failed in require at C:/perl/lib/utf8_heavy.pl line 2. BEGIN failed--compilation aborted at C:/perl/lib/utf8_heavy.pl line 2. Compilation failed in require at C:/perl/lib/utf8.pm line 17.
If the "my" is taken out, it prints the expected 5. But why is it getting this error? I'm not trying to my $strict::VERSION as the error says. I'm using version 5.8.0, apparently it works fine in 5.6.0, is this a bug?

--MrNobo1024
s]]HrLfbfe|EbBibmv]e|s}w}ciZx^RYhL}e^print

Comment on Getting error when declaring utf8 variable as lexical
Select or Download Code
Re: Getting error when declaring utf8 variable as lexical
by Courage (Parson) on Aug 10, 2002 at 19:16 UTC
    My guess - that variable name is just not correct utf8. You can freely use most weird variable names without "strict":
    ${"weird var name even with a space in it!"} = 'qwerty'; print ${"weird var name even with a space in it!"};
    That code works, and even stranger variable names will work without "strict".

    To be more specific, what exactly hexadecimal codes of that strange variable name?

    Courage, the Cowardly Dog

      C4 80. It's the character U+0100.

      --MrNobo1024
      s]]HrLfbfe|EbBibmv]e|s}w}ciZx^RYhL}e^print

        Because U+0100 is not a letter! Try some another letter, say, Russian small che, it's code U+0447 (which is C8 87 in utf8). I checked, it works!

        Courage, the Cowardly Dog

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://189214]
Approved by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-09-22 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (207 votes), past polls