[VPM] a little bit of perlophilia

Peter Scott Peter at PSDT.com
Fri Mar 14 17:52:38 CST 2003


At 03:31 PM 3/14/03 -0800, nkuipers wrote:
>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;

Maybe you'll like this:

% perl -le 'package Hello; $,=", ";sub World { split /::/, 
(caller(0))[3] } print World Hello'

>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.  :)

You sure have.  Who was it was chastising me not long ago for shorthand 
idioms :-)

>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.

Have you seen POLECAT? (http://history.perl.org/oneliners/)?

Or http://www.cpan.org/misc/japh ?


--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/




More information about the Victoria-pm mailing list