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

Santa Hole 2 (tail.pl) Post Mortem

Thread Next
From:
Andrew.Savige
Date:
December 6, 2001 15:28
Subject:
Santa Hole 2 (tail.pl) Post Mortem
Message ID:
694BB7191495D51183A9005004C0B05408DFD6@ir-exchange-srv.ir.com.au
This hole was one by Ronald J Kimball with his first post
in the opening hours of the game.

It proved frustrating, as evidenced by Japhy's mid-game comment:
"Geez, I have three different solutions for tail.pl, ALL the
same length (19 chars).  Has someone gotten below 19?"
Japhy was able to go below 19 by using the Unix tail command:
#!/usr/bin/perl
exec
tail,-10,pop
though this was not allowed in this game.

*** Hole 2 (tail.pl) ***
--- Rick Klement --------------------- 19
print+(<>)[-10..-1]
--- Ala Qumsieh ---------------------- 19
#!perl
print+(<>)[-10..-1]
--- Rick Delaney --------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- BooK ----------------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Brad Greenlee -------------------- 19
print+(<>)[-10..-1]
--- Piers Cawley --------------------- 19
#!perl
print+(<>)[-10..-1]
--- Damian James --------------------- 19
print+(<>)[-10..-1]
--- Yanick --------------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Eugene van der Pijll ------------- 19
print+(<>)[-10..-1]
--- Evan A Zacks --------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Ian Phillipps -------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Ian Boreham ---------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Japhy ---------------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Jerome Quelin -------------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Jonathan E Paton ----------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- me-01@ton.iguana.be -------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Karsten Sperling ----------------- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Robin Houston -------------------- 19
print+(<>)[-10..-1]
--- Ronald J Kimball ----------------- 19
#!/usr/local/bin/perl
print+(<>)[-10..-1]
--- Simon Drabble -------------------- 19
print+(<>)[-10..-1]
--- Vladi Belperchinov-Shabanski ----- 19
#!/usr/bin/perl
print+(<>)[-10..-1]
--- Michael Lambert ------------------ 20
print((<>)[-10..-1])
--- Tony Payne ----------------------- 21
#!/usr/bin/perl
print@{[<>]}[-10..-1]
--- Keith C Ivey --------------------- 21
#! /usr/bin/perl
print@{[<>]}[-10..-1]
--- Tim Ayers ------------------------ 21
#!/usr/bin/perl
print@{[<>]}[-10..-1]
--- Anthony J Breeds-Taurima --------- 22
#!/usr/bin/perl
@_=<>;print@_[-10..-1]
--- Mark Suter ----------------------- 22
#!/usr/bin/perl
@A=<>;print@A[-10..-1]
--- Zed Lopez ------------------------ 22
@a=<>;print@a[-10..-1]
--- Scott Wessels -------------------- 22
#!/usr/bin/perl
print((<>)[-10..$.-1])
--- Dave O'Neill --------------------- 22
#!/usr/bin/perl
@_=<>;print@_[-10..-1]
--- Csaba Raduly --------------------- 22
#!perl
@_=<>;print@_[-10..-1]
--- Richard Proctor ------------------ 22
@_=<>;print@_[-10..-1]
--- Michael G Schwern ---------------- 26
#!/usr/bin/perl -0p
/(.*\n){0,10}\z/;$_=$&
--- Josh Shulz ----------------------- 35
#!/usr/bin/perl
@a=<>;print splice @a,$.<10?-$.:-10
--- Aaron D Marasco ------------------ 44
#!/usr/bin/perl -n
@N[$.]=$_;10..($N[$.-10]='');END{print@N}

--- anonymous ------------------------ 20
print((<>)[-10..-1])
--- anonymous ------------------------ 38
#!/usr/bin/perl
@a=<>;print splice @a,-(($.<10)?$.:10)


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