Perl poems
Some years ago I start to work as Perl developer. I like this programming language, because is is very flexible a effective. For beginners it will be hard to learn this language, but they can discover a great tool.
Here are some poems in Perl language:
Died at midnight
This is my first poem. Very very pessimistic, tepid, oppressive, ...
midnight.pl
#!/usr/bin/perl
die unless exists $join{t} ;
import grass ;
join 'party' or kill $yourself ;
#
# midnight.pl - Died at midnight.pl
#
# Copyright (c) 2006 Lubomir Host 'rajo' <rajo AT platon.sk>
# All rights reserved.
#
# $Author: rajo $
# $Date: 2006-02-04 00:39:07 +0100 (Sat, 04 Feb 2006) $
# $Revision: 3196 $
#
Output:
Died at midnight.pl line 3.
HOWTO open your mind
After a little moment I wrote the second poem. This poem is not so pessimistic and this program has very interesting function. Save this Perl code to file with name *howto::open-your-mind.pl (keep star on the beginning) and run it. Program will print his own source code (opened file = his mind).
With this howto packed into little package you don't need to afraid of Perl or your own mind.
*howto::open-your-mind.pl
#!/usr/bin/perl package howto; *mind = $0; open your, *mind; print map <your>, $mind; # # *howto::open-your-mind.pl - HOWTO open your mind # # Copyright (c) 2006 Lubomir Host 'rajo' <rajo AT platon.sk> # All rights reserved. # # $Author: rajo $ # $Date: 2006-02-04 00:33:59 +0100 (Sat, 04 Feb 2006) $ # $Revision: 3195 $ #
Who is Perl guru?
My first obfuscated Perl code.
who-is-perl-guru.pl
#!/usr/bin/perl
$x=sub{$s=0;map{$s+=$_}@_;$s%17};@_[1]=11;@==map{84+($z++%2?shift @_:18)}qw<P E R L>;
print map{chr&$x(map{ord}split//)+shift(@=)}sort qw"Who is Perl guru?";
#
# who-is-perl-guru.pl
#
# Copyright (c) 2006 Lubomir Host 'rajo' <rajo AT platon.sk>
# All rights reserved.
#
# $Author: rajo $
# $Date: 2006-02-05 18:03:09 +0100 (Sun, 05 Feb 2006) $
# $Revision: 3206 $
#



