|
Acme::please - intercal-compliant politesse |
Acme::please - intercal-compliant politesse
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
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, pctg and please.
pctg, which is short for ``percentage'', will be compared with rand(100)
and the null string will be returned if the random number is larger. The
efault value is 25.
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 ' please' and it is reccommended that
the practice of using a leading blank space be adhered to for readability,
following the examples above.
$please is exported into caller's package through the mechanism of
tieing ${caller().'::please'}. This can be suppressed by
using Acme::please with an empty list:
use Acme::please (); # if you don't need please in your package
David Nicol, <davidnico@cpan.org>
|
Acme::please - intercal-compliant politesse |