[Cologne-pm] Fwd: <fwp@simon-cozens.org> Fun with Perl, for a change

A. Pagaltzis pagaltzis at gmx.de
Thu Apr 10 13:22:27 CDT 2003


*g*

----- Forwarded message from Simon Cozens <fwp at simon-cozens.org> -----
> Sender: Simon Cozens <simon at netthink.co.uk>
> From: Simon Cozens <fwp at simon-cozens.org>
> Date: Thu, 10 Apr 2003 16:47:19 +0100
> To: fwp at perl.org
> Subject: Fun with Perl, for a change
> User-Agent: Mutt/1.4i-ja.1
> Message-ID: <20030410154719.GA2201 at deep-dark-truthful-mirror.pad>
> 
> Rob Dixon:
> > Can somebody suggest how I might resolve the following?
> > If I make a GET request to a server with a URL like
> >     http::/ww.domain.com/path/path/name
> > [... ordinary programming question ...]
> 
> I must be on the wrong list. See, I thought this was fun-with-perl, and
> boring programming questions just aren't fun. Even so, we've had nothing but
> this sort of thing for the past two months or so. I suggest we have some more
> fun.
> 
> Here's a piece of fun I came up with the other day. Who can work out how it
> works?
> 
>     use Ruby;
> 
>     $x = 10; 
>     print $x;                        # 10
>     $x++; 
>     $x.puts;                         # 11
>     $x.class.puts;                   # Fixnum
>     $x.class.class.puts;             # Class
> 
>     $x->upto(20, sub { $_.puts });   # 11, 12, 13, .. 20
> 
>     $y = "Hello, world";
>     $y->puts;                        # Hello, world
>     $y.class.puts;                   # String
>     $y->length.puts;                 # 12
> 
> No source filters, XS or any other Deep Magic is involved. It's all pure
> Perl.
> 
> -- 
> <quidity> Sometimes it's better not to pedant.
> 

----- End forwarded message -----

-- 
Gruss,
Aristoteles



More information about the Cologne-pm mailing list