On Tue, Jun 25, 2002 at 12:25:20PM +0200, Beno�t Chauvet wrote:
> Yes, but have you tried this ?
> -p ($_)=sort{abs$_-$a<=>abs$_-$b}<>  (35)

I like this solution, but after processing the input lines, it hangs waiting
for more input.  I was curious as to why this was happening, and found this in
perlop:

       The <> symbol will return "undef" for end-of-file only
       once.  If you call it again after this, it will assume you
       are processing another @ARGV list, and if you haven't set
       @ARGV, will read input from STDIN.

Is a Golf program required to terminate?  Amir referred to MLM emails (what are
those?) saying that using <> inside a -p loop is legal.  What's the official
call on this one?

On a side note, if anyone has Mtv's 32-stroke solution lying around, I'd love
to see it!

-- Mike

-- 
Michael W. Thelen
eval unpack 
u,'M*"1C/2<P,BDN-"`U+C`A(RLG*3U^>2\A+48O82UZ+SME=F%L*"1C+B(G=2HGM+"<Z,D<U4SU<(B%!.T9=5#HF-5(H)2%%/$907$`Z)B5#.E8U4BM@2&`G+EPD$+R(I.P``'

Reply via email to