RE: Trouble simplifying hash of array access

2006-08-09 Thread Smith, Jim R
Try this: @[EMAIL PROTECTED]'EST'}}; print $info[3]; regards, jimbob __ -Original Message- From: n[ate]vw [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 08, 2006 1:12 PM To: beginners@perl.org Subject: Trouble simplifying has

Re: Trouble simplifying hash of array access

2006-08-08 Thread n\[ate\]vw
Mumia W. wrote: On 08/08/2006 12:12 PM, n[ate]vw wrote: That gets repetitive, so I'd like to simplify it this way: @[EMAIL PROTECTED]'EST'}; print $info[3]; ...but that doesn't work! Nothing prints. What am I doing wrong? You're not using the array reference in zone_info correctly. my $i

Re: Trouble simplifying hash of array access

2006-08-08 Thread n\[ate\]vw
Tom Phoenix wrote: On 8/8/06, n[ate]vw <[EMAIL PROTECTED]> wrote: What am I doing wrong? You're probably not using 'use strict', else it would have given you a helpful diagnostic message that you'd find in the perldiag manpage. Cheers! Heh! I'll have to turn that on before starting my next

Re: Trouble simplifying hash of array access

2006-08-08 Thread Mumia W.
On 08/08/2006 12:12 PM, n[ate]vw wrote: I'm having some trouble using a hash of arrays. I thought I was starting to understand the jumbled mass of variable use in Perl, but perhaps not... Instead of the missing switch() statement, I'm using a hash set up like this: %zone_info = ( 'EST' =>

Re: Trouble simplifying hash of array access

2006-08-08 Thread John W. Krahn
n[ate]vw wrote: > I'm having some trouble using a hash of arrays. I thought I was starting > to understand the jumbled mass of variable use in Perl, but perhaps not... > > Instead of the missing switch() statement, I'm using a hash set up like > this: > > %zone_info = ( > 'EST' => [5,'EST', 4,'

Re: Trouble simplifying hash of array access

2006-08-08 Thread Tom Phoenix
On 8/8/06, n[ate]vw <[EMAIL PROTECTED]> wrote: What am I doing wrong? You're probably not using 'use strict', else it would have given you a helpful diagnostic message that you'd find in the perldiag manpage. Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PR

Trouble simplifying hash of array access

2006-08-08 Thread n\[ate\]vw
I'm having some trouble using a hash of arrays. I thought I was starting to understand the jumbled mass of variable use in Perl, but perhaps not... Instead of the missing switch() statement, I'm using a hash set up like this: %zone_info = ( 'EST' => [5,'EST', 4,'EDT'], 'EST5' => [5,'EST-']