Re: slices of hashes

2005-07-21 Thread Gerard Robin
On Thu, Jul 21, 2005 at 04:04:36PM -0400 Scott R. Godin wrote: > Gerard Robin wrote: > >Hello, > >the slices of hashes work strangely ... > > > > >PS > >if I write: > >@h3{"Mamadoo".."Lulu"} = (30, 40, 50 ); > >the script hangs (no error is displayed) > > > > yes because that's not a hash slice t

Re: slices of hashes

2005-07-21 Thread Jeff 'japhy' Pinyan
On Jul 21, Gerard Robin said: my %h1 = (a => 1, b => 2, c => 3, d => 4, e => 5, f => 6); [snip] print " ", map{ $_." " } @h1{'b'..'e'}; [snip] @h1{'b'..'e'} = (20, 30, 40, 50); print " ", map{ $_." " } @h1{'b'..'e'}; What do you think 'b'..'e' is producing? It's producing the list ('b',

Re: slices of hashes

2005-07-21 Thread Scott R. Godin
Gerard Robin wrote: Hello, the slices of hashes work strangely ... PS if I write: @h3{"Mamadoo".."Lulu"} = (30, 40, 50 ); the script hangs (no error is displayed) yes because that's not a hash slice there: what happens when you do these: ? perl -wle 'print "Mamadoo","Lulu"' perl -wle 'pr