Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Local for lexicals

by ikegami (Patriarch)
on Aug 12, 2009 at 16:56 UTC ( [id://787978]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Lambda;
    
    ...
    }
    
    1;
    
  2. or download this
    use strict;
    use warnings;
    ...
       my $f = lambda($x => sub { $x });
       is($f->('test'), 'test', 'tied');
    }
    
  3. or download this
    1..10
    ok 1 - use Lambda;
    ...
    #          got: undef
    #     expected: 'test'
    # Looks like you failed 2 tests of 10.
    
  4. or download this
    package Lambda;
    
    ...
    }
    
    1;
    
  5. or download this
    use strict;
    use warnings;
    ...
       my $f = lambda { $_ };
       is($f->('test'), 'test', 'tied');
    }
    
  6. or download this
    1..6
    ok 1 - use Lambda;
    ...
    ok 4 - restore
    ok 5 - alias
    ok 6 - tied
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found