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

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




Vicki Brown wrote:
> 
> If you're gonna reply with a spoiler, mark it a spoiler.
> 
> If you were there, don't jump in so fast :-)
> 
> What does this print? And why?
> 
>    use constant e => 2, pi => 3;
> 
>    print e ** pi;

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'

is really

    print 0 ** 0

is really

    print 1;


/prakash

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