Re: Wanted: Explanation of array slices used in hash creation

2001-06-27 Thread Me
@$hashref{@array}; One thing I remember finding useful in understanding this sort of stuff is that the sigils (@, $, etc.) are more binding (have a higher precedence, as it were), than subscript parens. So you deal with them first. So @ followed by other sigils is going to end up with a bunch of

Re: Wanted: Explanation of array slices used in hash creation

2001-06-27 Thread Jeff 'japhy' Pinyan
On Jun 27, Peter Cline said: >After studying examples in "Effective Perl Programming" I devised the >following working code snippet: > >@people{@newkeys} = @$contact{sort keys %$contact}; All a slice is, is a list of elements of the structure. @array[1,3,5] is ($array[1], $array[3], $arr

Wanted: Explanation of array slices used in hash creation

2001-06-27 Thread Peter Cline
After studying examples in "Effective Perl Programming" I devised the following working code snippet: @people{@newkeys} = @$contact{sort keys %$contact}; I am trying to understand exactly how and why it works. This appears in a subroutine that is passed a hash reference ($contact) @newkeys is d