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

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



"Derek J. Balling" <dredd@megacity.org> wrote:
> At 08:27 PM 8/25/99 -0400, Keith Calvert Ivey wrote:
> >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');
> 
> No, actually, he's right... try doing:
> 
> print e;
> 
> He's correct. :)  Orwant was wrong (he said it would contain "2") but it 
> really contains "2pi3"

No, actually, I'm right.  Try doing

  $, = ',';
  print e;

or maybe

  print (2, 'pi', 3);

or even

  print e + pi;

and you'll see what's going on.

  

-- 
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