Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Bug : eval and accent

by Somni (Friar)
on Nov 16, 2007 at 10:17 UTC ( #651160=note: print w/replies, xml ) Need Help??

in reply to Bug : eval and accent
in thread Bug : eval and accent

Hm, this is a strange one. While the accented variable name is important, the 'my' declaration is also important.

eval qq/my \$v\xE9/; eval q/print $string; $string = "new value"/; print $@ if $@;
Results in the error:
"my" variable $string masks earlier declaration in same scope at (eval 2) line 1.

Somehow $string is being declared lexical in the second eval. The specific error being triggered in the first eval (Unrecognized character \xE9) has a special case in toke.c, and I can only think this early exit is leaving the tokenizer in an odd state.

You should report this bug using the perlbug program you should have installed on your system. If you wish to include the details I've mentioned please feel free.

Replies are listed 'Best First'.
Re^2: Bug : eval and accent
by Anonymous Monk on Nov 16, 2007 at 10:58 UTC
    Thanks monks for your responses... i report a perl bug soon...

      i have reported a perl bug (47517)

        This has been an interesting thread so out of curiosity I happened to check on the bug report. According to Dave Mitchell:
        Thanks for the report. This is fixed in perl 5.9.5 onwards, probably by change #31203. PL_in_my wasn't being re-initialised at the start of the eval, so '$string' was being misinterpreted as 'my $string'.
        Looks like Somni had it right in Re: Bug : eval and accent.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://651160]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2023-11-30 08:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found