It is interesting, that your thinking in general can affect the code you produce. I am only a beginner at perl, however, I received light in this vision of Optimistic Expression through Perl.
#!/usr/bin/perl -w # # This dawned on me, that you can tell a persons # outlook on life, based upon the way they use their # Regular expressions. # ######################################### use strict; #philosophy my $answer = 555; # watch the mind of a pessimist, always thinking # negative. if ($answer !~ /\d+/) { print "Pessimist"; } # Now the optimist if ($answer =~ /\d\d\d/) { print "Optimist"; } print "\nTest your Perl monk friends, do they always think negative?\n +";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sutra of Optimism
by demerphq (Chancellor) on Nov 27, 2002 at 11:34 UTC | |
Re: Sutra of Optimism
by BUU (Prior) on Nov 27, 2002 at 06:52 UTC | |
by diotalevi (Canon) on Nov 27, 2002 at 07:54 UTC | |
by submersible_toaster (Chaplain) on Nov 28, 2002 at 06:44 UTC | |
by Dog and Pony (Priest) on Nov 28, 2002 at 15:28 UTC | |
Re: Sutra of Optimism
by belg4mit (Prior) on Nov 27, 2002 at 19:45 UTC | |
by shirkdog_perl (Beadle) on Nov 28, 2002 at 00:44 UTC | |
Beware the nihilist
by frankus (Priest) on Dec 09, 2002 at 11:43 UTC |
Back to
Perl Poetry