Acme-Shotgun
view release on metacpan or search on metacpan
# METHODS
## new(%args)
Constructs and returns a new Acme::Shotgun object. The gun is automatically
reloaded on construction.
my $gun = Acme::Shotgun->new(
type => 'double', # 'double' (default) or 'pump'
load => 'bird', # 'bird' (default), 'buck', or 'slug'
shots => undef, # optional: cap the number of rounds loaded
quiet => 0, # suppress all output
debug => 0, # dry-run mode, no file modifications
verbose => 1, # verbose output (disabled automatically if quiet)
);
Dies with an error if an invalid `type` or `load` value is given.
## reload()
Loads the magazine for the current shotgun type and ammunition. Default
lib/Acme/Shotgun.pm view on Meta::CPAN
use warnings;
our $VERSION = '0.03';
sub new {
my ($class, %args) = @_;
my $self = {
type => 'double',
load => 'bird',
shots => undef,
quiet => 0,
debug => 0,
verbose => 1,
num_rounds => 0,
%args,
};
die "Invalid shotgun type '$self->{type}'! Must be 'double' or 'pump'.\n"
unless $self->{type} =~ /^(?:double|pump)$/;
lib/Acme/Shotgun.pm view on Meta::CPAN
=head1 METHODS
=head2 new(%args)
Constructs and returns a new Acme::Shotgun object. The gun is automatically
reloaded on construction.
my $gun = Acme::Shotgun->new(
type => 'double', # 'double' (default) or 'pump'
load => 'bird', # 'bird' (default), 'buck', or 'slug'
shots => undef, # optional: cap the number of rounds loaded
quiet => 0, # suppress all output
debug => 0, # dry-run mode, no file modifications
verbose => 1, # verbose output (disabled automatically if quiet)
);
Dies with an error if an invalid C<type> or C<load> value is given.
=head2 reload()
Loads the magazine for the current shotgun type and ammunition. Default
( run in 3.740 seconds using v1.01-cache-2.11-cpan-d80b1682f3f )