[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] perl5 is 5



On Tue, 19 Oct 1999 17:46:52 +0100 (BST), you wrote:

> perl5 is 5.

And three wise men from perlland came and brought gifts.

"I bring you the gift of Common Sense," said the first.


------------------------ cut ------------------------
package Common::Sense;

use strict;
use constant UNIVERSE => 42;
use vars qw(@ISA $VERSION @EXPORT);
use Exporter;

@ISA = qw(Exporter);
@EXPORT = qw(UNIVERSE twice thrice forever);
$VERSION = 0.01;

sub twice  (&) { my $coderef = shift; &$coderef for   1..2 }
sub thrice (&) { my $coderef = shift; &$coderef for   1..3 }
sub forever(&) { my $coderef = shift; &$coderef while 1    }

"Thus endeth common sense";
------------------------ cut ------------------------

And he spake: "Go forth and say:"

------------------------ cut ------------------------
use Common::Sense;
thrice  { print $i++, " and counting...\n" };
twice   { print $i++ };
forever { print $i++,"\n" };
------------------------ cut ------------------------
use Common::Sense;
while (exists $::{UNIVERSE}) { print $i++,"\n" }
------------------------ cut ------------------------


The second wise man stepped forward and said...

<Well, what did the other two wise men give unto perl?>


-- 
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe