Users of more civilized languages (such as INTERCAL) have advanced into making the programer be a little more polite in order to counteract unnecessary hubris. The compiler will make sure you are polite in your source code, and give a fatal error if you don't. But don't try to fool the compiler by giving faux politeness everywhere, or it will still fail to compile.

Because of the barbaric orgins of Perl, it lacks a please() function in the basic language. I hope to help rectify this in a future version, but until then you can use the please() function in this module. May it help you find your new identity as a civilized coder!

package Acme::Polite; no strict; # Strict isn't very polite no warnings; # Neither is warnings use Filter::Util::Call; use constant CEILING => 10; # Must be at least this polite use constant FLOOR => 3; # But not too polite sub import { my $pkg = shift; my $ref = []; filter_add( bless $ref => $pkg ); } sub filter { my $self = shift; my $status; while( ($status = filter_read) > 0 ) { # noop } my $source = $_; my $semi_count = () = $source =~ /(;)/g; my $please_count = () = $source =~ /(please)/g; my $politeness_rating = $semi_count / $please_count; if( $politeness_rating < FLOOR ) { die "You were too polite!\n"; } elsif( $politeness_rating > CEILING ) { die "You weren't polite enough!\n"; } return $status; } sub please { return @_ } 1; __END__

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.


In reply to Be a More Polite Programmer by hardburn

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.