Acme-please
view release on metacpan or search on metacpan
use Acme::please;
print "will you$please sit down?\n" for 1..10; # two and a half pleases
tie $plz => Acme::please, pctg => 70;
print "will you$plz sit down?\n" for 1..10; # expect seven pleases
tie $plait => Acme::please, please => " s'il vous plait";
print "will you sit down$plait?\n" for 1..10; # expect 2.5 pleases in French
=head1 DESCRIPTION
A tie interface for creating scalar variables that have a percentage chance
of having either a predetermined value or they are empty strings when
evaluated. The tie interface takes two named arguments, C<pctg> and C<please>.
=head2 pctg
C<pctg>, which is short for "percentage", will be compared with C<rand(100)>
and the null string will be returned if the random number is larger. The
efault value is C<25>.
=head2 please
C<please>, named in honor of the legendary "politesse" compilation requirement
of Intercal, is the string which will be returned when the random number is
not larger. The default value is C<' please'> and it is reccommended that
the practice of using a leading blank space be adhered to for readability,
following the examples above.
( run in 0.349 second using v1.01-cache-2.11-cpan-709fd43a63f )