/usr/share/perl5/Aspect/Guard.pm is in libaspect-perl 1.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | package Aspect::Guard;
=pod
=head1 NAME
Aspect::Guard - General purpose guard object for destroy-time actions
=head1 SYNOPSIS
SCOPE: {
my $guard = Aspect::Guard->new( sub {
print "Goodbye World!\n";
} );
}
# Prints here as it exits the scope
=head1 DESCRIPTION
The B<Aspect::Guard> class shipping with L<Aspect> is a convenience module for
creating C<CODE> based objects that execute when they fall out of scope.
It's usage is effectively summarised by the synopsis.
=head1 METHODS
=cut
use strict;
our $VERSION = '1.04';
=pod
=head2 new
my $guard = Aspect::Guard->new( sub { do_something(); } );
The C<new> method creates a new guard object. It takes a single C<CODE>
references as a parameter, which it will bless into the guard class, which will
execute the code reference when it's C<DESTROY> hook is called.
=cut
sub new {
bless $_[1], $_[0];
}
sub DESTROY {
$_[0]->();
}
1;
=pod
=head1 AUTHOR
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2011 - 2013 Adam Kennedy.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
|