Acme-Insult-Glax

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

[![Actions Status](https://github.com/sanko/Acme-Insult-Glax/actions/workflows/ci.yml/badge.svg)](https://github.com/sanko/Acme-Insult-Glax/actions) [![MetaCPAN Release](https://badge.fury.io/pl/Acme-Insult-Glax.svg)](https://metacpan.org/release/Acm...
# NAME

Acme::Insult::Glax - Programmatically Generate Insults

# SYNOPSIS

```perl
use Acme::Insult::Glax qw[insult];
say insult( );
```

# DESCRIPTION

Acme::Insult::Glax provides 'insulting' statements generated by the RESTful libInsult API.

# METHODS

These functions may be imported by name or with the `:all` tag.

lib/Acme/Insult/Glax.pm  view on Meta::CPAN


=encoding utf-8

=head1 NAME

Acme::Insult::Glax - Programmatically Generate Insults

=head1 SYNOPSIS

    use Acme::Insult::Glax qw[insult];
    say insult( );

=head1 DESCRIPTION

Acme::Insult::Glax provides 'insulting' statements generated by the RESTful libInsult API.

=head1 METHODS

These functions may be imported by name or with the C<:all> tag.

=head2 C<insult( [...] )>

script/glax_insult.pl  view on Meta::CPAN

#~ @ARGV = qw[-h];
#
my $raw = 0;

sub _echo ($insult) {    # JSON::Tiny is loaded in Acme::Insult::Glax anyway
    $raw ? JSON::Tiny::encode_json( {%$insult} ) : $insult;
}
GetOptions( \my %h, 'who=s', 'template=s', 'plural!', 'help' => sub { pod2usage( -exitval => 1 ) }, 'json!' => \$raw, 'adjective!', 'sfw!' );
$h{lang} = 'en_corporate' if delete $h{sfw};
my $shade = delete $h{adjective} ? Acme::Insult::Glax::adjective( $h{lang} ) : Acme::Insult::Glax::insult(%h);
exit !( $shade ? say _echo($shade) : !say( $raw ? 'null' : '' ) );
__END__

=head1 NAME

glax_insult - Generate insults on the terminal

=head1 SYNOPSIS

    glax_insult                                  # generate a random insult
    glax_insult -template='...'                  # generate insults with a specific format



( run in 1.204 second using v1.01-cache-2.11-cpan-800906f7e73 )