ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Guard/Guard.pm
(Generate patch)

Comparing Guard/Guard.pm (file contents):
Revision 1.14 by root, Sat Dec 13 22:05:20 2008 UTC vs.
Revision 1.15 by root, Sat Dec 13 22:09:25 2008 UTC

10 # to go back to "/" no matter how myfun exits: 10 # to go back to "/" no matter how myfun exits:
11 sub myfun { 11 sub myfun {
12 scope_guard { chdir "/" }; 12 scope_guard { chdir "/" };
13 chdir "/etc"; 13 chdir "/etc";
14 14
15 call_function_that_might_die_or_other_fun_stuff; 15 code_that_might_die_or_does_other_fun_stuff;
16 } 16 }
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
19 19
20This module implements so-called "guards". A guard is something (usually 20This module implements so-called "guards". A guard is something (usually

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines