Re: Interpolated code blocks may not create lexicals

"David Nicol" <[email protected]> Thu, 25 Sep 2008 15:08:21 -0500
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On 9/25/08, Eirik Berg Hanssen <[email protected]> wrote:
>  print <<STR;
>  I like @{
>      my $rand = rand();
>      [$rand < 0.5 ? 'pie' : 'beer']
>  }
>  STR
>
>
>   You already have a block; no need for a do-block within it.
>
>
>   (The rest, others already covered.)

the "fun with perl" mailing list doesn't still exist, does it?

there's also

   	my $BeerOrPie;
 	sub BeerOrPie::TIESCALAR { bless \(my $x), 'BeerOrPie' };
 	sub BeerOrPie::FETCH { rand() < 0.5 ? 'pie' : 'beer'; };
 	tie $BeerOrPie, 'BeerOrPie';
        print "I like $BeerOrPie\n";

-- 
"checks and balances" is not financial jargon