Help for this page

Select Code to Download


  1. or download this
    sub d :lvalue {
       print("$_[0]: ", defined($_[1]) ? "[$_[1]]" : "undef", "\n");
    ...
    our $fred = 78;
    d("pre local", $fred);
    d("post local", local $fred);
    
  2. or download this
    pre local: [78]
    post local: undef
    
  3. or download this
    sub d :lvalue {
       print("$_[0]: ", defined($_[1]) ? "[$_[1]]" : "undef", "\n");
    ...
    our $fred = 78;
    d("pre local", $fred);
    d("post assign", d("post local", local $fred) = 90);
    
  4. or download this
    pre local: [78]
    post local: undef
    post assign: [90]