Acme-Daily-Fail

 view release on metacpan or  search on metacpan

lib/Acme/Daily/Fail.pm  view on Meta::CPAN


#  Returns a Daily Mail Headline as a string
sub get_headline {
	my @sentence;

  my $subject = _getRandom($subjects);
	my $phrase = _getRandom($transitive_phrases);
	my $verb = _getRandom($auxiliary_verbs);
	my $object = _getRandom($objects);

	$sentence[0] = _match_verb_and_subject($subject, $verb);
	$sentence[1] = $subject->[WORD];
	$sentence[2] = _match_verb_and_tense($verb, $phrase);
	$sentence[3] = $object;
  $sentence[4] = $phrase->[OBJECT] if $phrase->[OBJECT];

	my $s = join ' ', map { uc } @sentence;
	$s .= '?';

	return $s;
}

qq[BLOODY IMMIGRANTS];

__END__

=pod

=encoding UTF-8

=head1 NAME

Acme::Daily::Fail - generate random newspaper headlines

=head1 VERSION

version 1.24

=head1 SYNOPSIS

  use strict;
  use warnings;

  use Acme::Daily::Fail qw(get_headline);

  print get_headline(), "\n";

=head1 DESCRIPTION

Acme::Daily::Fail provides a single function that when called generates a
random newspaper headline which is typical for a certain UK newspaper title.

=head1 NAME

=head1 FUNCTION

=over

=item C<get_headline>

Not exported by default, takes no parameters, returns a randomly generated headline.

=back

=head1 BASED ON

Based on the Daily-Mail-o-matic by Chris Applegate
L<http://www.qwghlm.co.uk/toys/dailymail/>

=head1 SEE ALSO

L<http://www.qwghlm.co.uk/toys/dailymail/>

=head1 AUTHOR

Chris Williams <chris@bingosnet.co.uk>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2025 by Chris Applegate and Chris Williams.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 1.601 second using v1.01-cache-2.11-cpan-140bd7fdf52 )