develooper Front page | perl.golf | Postings from July 2002

Re: more minigolf

Thread Previous | Thread Next
From:
perl-golf
Date:
July 11, 2002 11:26
Subject:
Re: more minigolf
Message ID:
agkii8$umj$1@post.home.lunix
In article <3D2DC753.6050300@clotho.com>,
	Chris Dolan <chris@clotho.com> writes:
> Phil Carmody wrote:
>> 
>> What is 
>>  @{[ ... ]} 
>> ?
>> 
>> It's not in perlsyn, perlop, perlvar ...
>> 
> 
> It's like this:
> 
> $ref = [$w=1,map$w*=$_/--$;,-pop..-1];
> print "@$ref\n";
> 
> only with an anonymous array reference and dereference.  I keep
> forgetting about that one, too.  It would have helped most of my
> solutions...

Another fun thing of my solution is that the value printed first is a copy
of the value printed last, NOT the 1 that gets assigned originally.
(as you can see by trying print"@{[$w=1,map$w*=$_/--$n,-pop..-2]}\n")

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