Changes between Version 27 and Version 28 of Features


Ignore:
Timestamp:
Sep 13, 2009, 5:57:06 PM (5 years ago)
Author:
szabgab
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Features

    v27 v28  
    2727 
    2828=== Lexically Rename Variable === 
     29 
     30{{{ 
     31 
     32my $x = 23; 
     33{ 
     34  my $x = 42; 
     35  { 
     36    my $x = 19; 
     37    print $x;  # 19 
     38  } 
     39  print $x;    # 42 
     40} 
     41 
     42print $x;      # 23 
     43}}} 
     44 
     45In the above code the programmer used the same variable name in several scopes. 
     46We would like to replace the one in the middle where $x is 42. We cannot replace it 
     47based on selection as that would rename the internal variables ($x = 19) as well. 
     48 
     49We can select one of the occurrences of $x that we want to replace, right-click on the mouse, 
     50select "Lexically Rename Variable", type in a new name and click OK. It will 
     51replace the correct variable (Once the bugs reported in  #565 are fixed). 
    2952 
    3053=== Extract Subroutine ===