Help for this page

Select Code to Download


  1. or download this
    ...
    my $guard = My::Guard->new(sub { $sth->finish });
    ...
    
  2. or download this
    ...
    my $guard1 = My::Guard->new(sub { $sth->finish });
    ... some code which needs the protection of guard1 ...
    my $guard2 = My::Guard->new(sub { .. clear up something else ..; $guar
    +d1; });
    ... some code which needs the protection of both guards, and the order
    + of resource clearing is important ...