Feature #8859

Possibility to declare local varibles like "my" in Perl

Added by Dmitry Bolshakov 8 months ago. Updated 8 months ago.

[ruby-core:57006]
Status:Rejected
Priority:Normal
Assignee:-
Category:-
Target version:-

Description

Hi
I think it would be useful to have an analogue of the "my" keyword in Perl
e.g.
x = 'outer value'
p = Proc.new {
...
many code here
...
my x = 'local value does not affect outer variable'
}
I know I can declare local variables in the beginning of the block with a semicolon |;x|
but imho special keyword would be more handy

History

#1 Updated by Yukihiro Matsumoto 8 months ago

  • Status changed from Open to Rejected

If you are proposing to introduce 'my' keyword to the language, there's no chance.
Introducing new keyword can cause compatibility problems, so that it should be very beneficial.

Otherwise please be concrete.

Matz.

Also available in: Atom PDF