Jeff,

Just another doubt -
        
Why it gives syntax error when -
        my @myhash{qw/A B/} = ();

It works when I say -
        my %myhash ;
        @myhash{qw/A B/} = ();   

Thanks
Alok

-----Original Message-----
From: Jeff Pang [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 01, 2007 3:21 PM
To: Nath, Alok (STSD)
Cc: beginners@perl.org
Subject: Re: Simplest hash initialization with no value

Nath, Alok (STSD) 写道:
> Hi,
>       What is the simplest way to initialize the hash keys with no values ?
> 
>       I know the crude form :
> 
>       %myhash =('A' => undef,
>                   'B' => undef) ;
> 
>       Is there anything simpler than this ?
> Thanks,
> Alok
> 

Maybe you want,

@myhash{qw/A B/} = ();

--
http://home.arcor.de/jeffpang/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to