Games-Dissociate
view release on metacpan or search on metacpan
lib/Games/Dissociate.pm view on Meta::CPAN
if(@ARGV) {
Getopt::Std::getopts('c:w:m:', \%o)
or die "Options:
-cNUMBER
Run a by-character dissociation with that number of
characters as the group size.
-wNUMBER
Run a by-word dissociation with that number of
words as the group size.
-mNUMBER
Specifies how many iterations the dissociator loop should make.
";
}
my $o;
my $max;
if($_[0]) {
$o = $_[0];
} elsif($o{'w'}){
$o = - abs($o{'w'});
} elsif($o{'c'}){
lib/Games/Dissociate.pm view on Meta::CPAN
with a group-size of that many characters (4 = 4 characters); a
negative value means you want to dissociate by word, with a group size
of that many words (-2 = 2 words). I suggest values between -3 and 5;
I'm a fan of -2. A $group_size value of 0 or 1 is invalid, and
currently causes C<dissociate> to use the default value of 2 (2
characters) instead. A value of -1 is invalid, and currently causes
C<dissociate> to use the value of -2 (2 words) instead. The
behavior/validity of $group_size values of 0, 1, or -1 may change in
future versions.
$max is a parameter used to control the maximum number of iterations
of C<dissociate>'s central loop -- it corresponds roughly to the
number of "chunks" of text you get back, where a chunk is N *
-$group_size words for negative values of $group_size, and N *
$group_size characters for positive values of $group_size. $max must
be greater than 1.
If you need (!) more precise control over the size of the output text,
try setting set $max high and trim the output to size, and/or try
calling C<dissociate> multiple times until you get the amount of output
you want. (But be sure to give up if C<dissociate> keeps returning
( run in 0.828 second using v1.01-cache-2.11-cpan-71847e10f99 )