1 package CPANPLUS::Dist::Gentoo::Guard;
8 CPANPLUS::Dist::Gentoo::Guard - Scope guard object.
16 our $VERSION = '0.09';
20 This is a scope guard object helper for L<CPANPLUS::Dist::Gentoo>.
24 =head2 C<new $coderef>
26 Creates a new L<CPANPLUS::Dist::Gentoo::Guard> object that will call C<$coderef> when destroyed.
31 my ($class, $code) = @_;
32 $class = ref($class) || $class;
42 Tells the object not to call the stored callback on destruction.
46 sub unarm { $_[0]->{armed} = 0 }
50 Calls the stored callback if the guard object is still armed.
57 $self->{code}->() if $self->{armed};
65 L<CPANPLUS::Dist::Gentoo>.
69 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
71 You can contact me by mail or on C<irc.perl.org> (vincent).
75 Please report any bugs or feature requests to C<bug-cpanplus-dist-gentoo at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPANPLUS-Dist-Gentoo>.
76 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
80 You can find documentation for this module with the perldoc command.
82 perldoc CPANPLUS::Dist::Gentoo
84 =head1 COPYRIGHT & LICENSE
86 Copyright 2009,2010 Vincent Pit, all rights reserved.
88 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
92 1; # End of CPANPLUS::Dist::Gentoo::Guard