This is prompted by WitchTest - A Tool For Determining If A Woman Is Guilty Of Witchcraft - somewhat modernized...

package Test::Terr'ist; # save as Test/Terr/ist.pm use overload '""' => \&call_upon,fallback => 1; our @charges = ( "dates for coffee breaks without telling place and/or time", "conspires at coffee breaks with the mobile turned off", "reads books without us knowing", "uses key words terrorrists use", "discusses political matters at high level", "can author sophisticated texts", "remembers school physics", "has other suspects on his rolodex", "questions official 9/11 story", # expand as appropriate ); sub suspect { my $inquiry = shift; my $specimen = { name => shift || "Anonymous"}; bless $specimen, $inquiry; } sub call_upon { $_[0]->{name} } sub AUTOLOAD { my $proof = shift; $AUTOLOAD =~ s/.*:://; *{$AUTOLOAD} = sub { $charges[rand @charges] }; goto &$AUTOLOAD; } sub can { my ($self, $func) = @_; # we might be subclassed my $parent = $self->SUPER::can( $func ); return $parent if $parent; my $pkg = ref( $self ) || $self; local $@; my $ref; $ref = eval { local $SIG{__DIE__}; $ref = $self->$func; } or return undef; no strict 'refs'; no warnings 'redefine'; *{ $pkg . '::' . $func } = $ref; $ref; } # XXX (2014-07-24) FIXME - return a NSA::Local object; qw(BND BKA LKA Innenministerium SPD CDU CSU);
#!/usr/bin/perl use Test::Terr'ist; use strict; my $suspect = Test::Terr'ist->suspect(shift || "this individual"); if ( $suspect->can("boom") ) { my %findings; print "$suspect is a Terrorist because:\n"; my @facts = @ARGV ? @ARGV: @Test::Terr'ist::charges; $findings{$suspect->$_}++ for @facts; my $sum; $sum += $findings{$_} for keys %findings; printf " %.2f%%: $_\n", $findings{$_} / $sum * 100, $_ for keys % +findings; } else { print "$suspect is not found to be a terr'ist.\n"; print "please file a bug report for Test::Terr'ist.\n"; print "Thank you.\n"; }

References:
Wie wird man Terrorist? (german)
Guantánamo in Germany
update: Blacklisted

...my 3rd "Silly Uses Of Perl" post after Clock that goes backwards and yet another time module...


In reply to "Are You A Terr'ist?" by shmem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.