BooK <[EMAIL PROTECTED]> writes:
> En r�ponse � Piers Cawley <[EMAIL PROTECTED]>:
>
>> Michael G Schwern <[EMAIL PROTECTED]> writes:
>> 
>> > On Fri, Dec 07, 2001 at 10:36:50AM +1100, [EMAIL PROTECTED]
>> wrote:
>> >> --- Piers Cawley --------------------- 21
>> >> #!/usr/bin/perl -lp
>> >> $#='%010g'}{$_=$.
>> > 
>> > Shouldn't that be 20?
>> 
>> Nope. The space before the '-' counts.
>>
>> But I was pretty proud of this one. And surprised that nobody else
>> found it. Course, I'm still annoyed that I found this but not the $\
>> based reverse.
>
> I love this one. As an added bonus, perlvar says "Use of $# is deprecated."

Indeed. And it doesn't quite work in all cases either. An early
version looked like:

#!perl -pl
$#='%010g'}for($.){

Okay, so it was longer than the final version but bear with me. The
thing is, it doesn't work. And I don't quite know why.

-- 
Piers

   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?

Reply via email to