[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] From the Perl Conference 3.0 Perl quiz (2)



Prakash Kailasa <PrakashK@bigfoot.com> wrote:

> Spoiler ---
>           |
>           v
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> It prints 1.
> 
>     use constant e => 2, pi => 3;
> 
> This really creates a list constant (2, 'pi', 3);
> 
>     print e ** pi;
> 
> is really,
> 
>     print '2pi3' ** 'pi'

Not quite.  You mean 

      print ((2, 'pi', 3) ** 'pi');

> is really
> 
>     print 0 ** 0

      print 3 ** 0;
 
> is really
> 
>     print 1;

Yes.

-- 
Keith C. Ivey <kcivey@cpcug.org>
http://cpcug.org/user/kcivey/
Washington, DC

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe