develooper Front page | perl.fwp | Postings from December 2001

Re: Santa Hole 5 (wc.pl) Post Mortem

Thread Previous | Thread Next
From:
Ian Phillipps
Date:
December 7, 2001 04:10
Subject:
Re: Santa Hole 5 (wc.pl) Post Mortem
Message ID:
20011207121044.A5819@homer.diplex.co.uk
On Fri, 07 Dec 2001 at 10:36:50 +1100, Andrew.Savige@ir.com wrote:
> This hole was one by Japhy with his first post in the opening
> hours of the game.

> Like hole 2, this proved very frustrating with all attempts
> to improve on printf failing.
Dead right :-)

> --- Tim Ayers ------------------------ 21
> #!/usr/bin/perl
> printf"%010d\n",$.,<>

Harumph. I remember something like this approach flitting through my
mind, but, I thought, the $. would be evaluated before the <>, so it
would be zero.

Moral: try it!

Hmm... why isn't it zero?

> --- Ian Phillipps -------------------- 25
> #!/usr/bin/perl
> printf"%010d\n",(@x=<>)+0

Ian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About