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

Re: [FWP] words words words



Bernie Cosell wrote:
> On 19 May 2000, at 9:17, tayers@bridge.com wrote:
> 
> Dumb question [as I try to puzzle out how/if this works].  Is this a 
> typo:
> 
> >     @t{@t} = (1) x @t;
>       ^
>        '%' here, perhaps??

No, '@'. It's a hash slice. Specifically, all the keys of %h corresponding
to the elements of @t are set to 1. So if @t = qw(foo bar zap), then this
sets @t{'foo', 'bar', 'zap'} = (1) x 3, the same as $f{'foo'} = 1; $f{'bar'}
= 1; $f{'zap'} = 1; .

Cheers,
Philip

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