# New Ticket Created by  Klaas-Jan Stol 
# Please include the string:  [perl #51560]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=51560 >


hi,

when running a language in interactive mode, and you declare a local
variable, then this local variable cannot be accessed afterwards.

This is true for perl 6 as well:

my $var = 1;

say $var;
No scope found for PAST::Var '$var'

Maybe for Perl 6 this is ok, but many other languages, such as Lua and
Python, this should work.

Somehow, this makes sense, when looking at the generated PIR. For each
input line, a new (anonymous) sub is generated and executed. Any local
declarations are local to that sub, and are lost after that point.

kjs

Reply via email to