[VPM] a little bit of perlophilia
abez
abez at abez.ca
Fri Mar 14 18:20:01 CST 2003
I like it!
Here is my rather large helloworld:
Ok do not change any of the spacing it actually relies on that and it contains nathan's message
Start cutting here --------
#Hi everyone, I was playing with Perl at 2:30 this morning. My play tu
#rned 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! "})->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 run
#s under strict and warnings pragmas no problem. When I consider each line carefully, I realize there is actua
#lly 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 u
#p with. If it turns out to be a fun and interesting thread, I'll post this on PerlMonks. Cheers, Nathana
#el ################################################################################################
seek DATA,0,0;
while(<DATA>){
chomp;
print chr(length($_))
if /#/;
}
__DATA__
---------- End Cutting here
The string it prints is "Hello World\n" (evaluate it).
abram
On Fri, 14 Mar 2003, 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;
>
> 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
>
--
abez ------------------------------------------
http://www.abez.ca/ Abram Hindle (abez at abez.ca)
------------------------------------------ abez
More information about the Victoria-pm
mailing list