Acme-Insult
view release on metacpan or search on metacpan
[](https://github.com/sanko/Acme-Insult/actions) [](https://metacpan.org/release/Acme-Insult)
# NAME
Acme::Insult - Code That Wasn't Raised Right
# SYNOPSIS
```perl
use Acme::Insult qw[insult];
say insult;
```
# DESCRIPTION
Acme::Insult is kind of a jerk.
# METHODS
These functions may be imported by name or with the `:all` tag.
lib/Acme/Insult.pm view on Meta::CPAN
=encoding utf-8
=head1 NAME
Acme::Insult - Code That Wasn't Raised Right
=head1 SYNOPSIS
use Acme::Insult qw[insult];
say insult;
=head1 DESCRIPTION
Acme::Insult is kind of a jerk.
=head1 METHODS
These functions may be imported by name or with the C<:all> tag.
=head2 C<insult( [...] )>
script/insult.pl view on Meta::CPAN
#
my $raw = 0;
my $flavor;
sub _echo ($insult) {
$raw && eval 'require JSON::Tiny' ? JSON::Tiny::encode_json( {%$insult} ) : $insult;
}
GetOptions(
\my %h, 'language=s',
'help' => sub { pod2usage( -exitval => 1 ) },
'flavors!' => sub { exit !say 'Supported insult flavors: ' . join ', ', Acme::Insult::flavors() },
'json!' => \$raw,
'glax!' => sub { $flavor = 'glax' },
'evil!' => sub { $flavor = 'evil' },
'pirate!' => sub { $flavor = 'pirate' },
);
my $shade = Acme::Insult::insult($flavor);
exit !( $shade ? say _echo($shade) : !say( $raw ? 'null' : '' ) );
__END__
=head1 NAME
insult - Generate insults on the terminal
=head1 SYNOPSIS
insult # generate a random insult
insult -json # insult someone if you're a robot
( run in 2.647 seconds using v1.01-cache-2.11-cpan-ff9377addf4 )