[VPM] a little bit of perlophilia
nkuipers
nkuipers at uvic.ca
Fri Mar 14 17:31:36 CST 2003
Hi everyone,
I was playing with Perl at 2:30 this morning. My play turned to "Hello
World!".
Don't ask me how my brain works, but this is what came out:
sub getName { (shift)->{name} }
print "Hello ", bless({name => "World!\n"})->getName;
It's object-based (I think, anyways when I threw a "ref or die" into getName
it printed properly), doesn't use any explicit variables, and runs under
strict and warnings pragmas no problem. When I consider each line carefully,
I realize there is actually a lot of going on there in the way of shorthands,
default behaviors etc., and I remember my very first days with Perl, and
realize I've come a little ways. :)
Anyways, reminiscing aside, I thought I would put this out to you all as an
opportunity to creatively breathe new life into "Hello World!". I'd love to
see what people came up with. If it turns out to be a fun and interesting
thread, I'll post this on PerlMonks.
Cheers,
Nathanael
More information about the Victoria-pm
mailing list