Perl hash help

Hi ,

i have the below code its working fine when i execute in unix , but its not working in windows could you pls explain me where i am going wrong.

This is the program

 $data = { '1' => 'one' ,
           '2' => 'two' ,
           3 => 'three'
         };

 print "hello : $data->{'1'} ";


 print "hi : ${%$data}{'2'} \n";

when i execute it in unix

output
-------------------------

 jena lab $ perl test.pl
hello : one hi : two

in windows
output:
-------------------------------

hello : one hi :  
Use of uninitialized value in concatenation (.) or string at D:/Docket-Workspace/Test/test1/sample1.pl line 9.

Can anyone help ?

Which release of Perl are you using in Windows? ( I see the same thing when warnings are enabled in Strawberry)

Dreferencing without an explicit conversion to a hash resolves this, ( and works with Perl in Unix) ie:

print "hi : ${$data}{'2'} \n";

Hi Skrynesaver,

but without dereferncing the hash how this will work ${$data}{'2'} , So what i need to do in window to make this
print "hi : ${%$data}{'2'} \n"; statement work......

this is the perl version in my windows

print "hi : ${%$data}{'2'} \n";

Thanks
Sridhar