#!/usr/local/bin/perl
# Time-stamp: "2005-08-21 15:58:20 ADT"   sburke@cpan.org
# desc{   torgonifies text, i.e., randomizes the capitalization   }
srand;  rand, rand, rand;

while(<>) { print &torgonify_string($_) }
print "Done\n";
exit;

sub torgonify_string {
    my($normal) = $_[0];
    my($uc) = uc($_[0]);
    return $_[0] unless $_[0] =~ /\w/;

    foreach(0 .. length($normal)) {
	substr($normal,$_,1) = substr($uc,$_,1) if int(rand(2));
    }
    return $normal;
}

__END__

=for html <a href="./torgo.pl">Download here</a>

=head1 NAME

torgo.pl - a Torgo-filter

=head1 SYNOPSIS

  torgo.pl resume.txt
  
  grep ^sl < /usr/dict/words | torgo.pl | mail -s hey root

etc.

=head1 DESCRIPTION

C<torgo.pl> will accept input text and then output in with random
uppercasing.

=head2 AN EMAMPLE

Input:

=over 2

"However, since the late 1980s, frequently updated electronic
bibliographies of specialist fields of knowledge (whether accessible on
CDROM or through online databases) have largely replaced print
bibliographies."

=back

Output:

=over 2

"HowEvER, SInCe tHe LATe 1980s, FreqUENtlY UpdatED eLEctRoNiC
BibLIogrAphIEs oF SpeCIaList FiElds Of KnOWledGE (WhEther aCcEssIble On
CDROM oR thrOugh oNLIne DatABASES) HAVe lARGeLy repLACED PRiNT
bIbLiOgRaPHIES."

=back


=head1 ACKNOWLEDGEMENTS

Thanks to Hal Warren, for writing and directing and producing that gem
of a movie, I<Manos, the Hands of Fate> (1966).

=head1 COPYRIGHT

Copyright 1998, Sean M. Burke (C<sburke@cpan.org>)

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

=cut

