1 package CPANPLUS::Dist::Gentoo::Guard;
8 CPANPLUS::Dist::Gentoo::Guard - Scope guard object.
16 our $VERSION = '0.12';
20 This is a scope guard object helper for L<CPANPLUS::Dist::Gentoo>.
26 my $guard = CPANPLUS::Dist::Gentoo::Guard->new($coderef);
28 Creates a new L<CPANPLUS::Dist::Gentoo::Guard> object that will call C<$coderef> when destroyed.
33 my ($class, $code) = @_;
34 $class = ref($class) || $class;
44 Tells the object not to call the stored callback on destruction.
48 sub unarm { $_[0]->{armed} = 0 }
52 Calls the stored callback if the guard object is still armed.
59 $self->{code}->() if $self->{armed};
67 L<CPANPLUS::Dist::Gentoo>.
71 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
73 You can contact me by mail or on C<irc.perl.org> (vincent).
77 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>.
78 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
82 You can find documentation for this module with the perldoc command.
84 perldoc CPANPLUS::Dist::Gentoo
86 =head1 COPYRIGHT & LICENSE
88 Copyright 2009,2010,2011,2012 Vincent Pit, all rights reserved.
90 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
94 1; # End of CPANPLUS::Dist::Gentoo::Guard