Help for this page

Select Code to Download


  1. or download this
    try { ... } catch { ... };
    
  2. or download this
    try(sub { ... }, catch(sub { ... }));
    
  3. or download this
    $ perl -wle'
        sub f { my $x = "abc"; sub { eval q{"[$x]"} } };
    ...
    Variable "$x" is not available at (eval 1) line 1.
    Use of uninitialized value in print at -e line 1.
    []
    
  4. or download this
    $ perl -wle'
        sub f { my $x = "abc"; sub { $x if 0; eval q{"[$x]"} } };
        print f()->();
    '
    [abc]