Questions tagged [perl-hash]

refers to the hash variable type in Perl. Other languages call this a dictionary or associate away.

64 questions
-4
votes
1 answer

perl how to assign the individual values out to variable

I am trying to assign the hash values to variables, but I'm unable to get each value assigned to a varIAble. Please share your thoughts say my %data = Dumper($data); $VAR1 = { 'cnt' => 2000, 'inc' => 30, 'start' =>…
coolent
  • 21
  • 8
-4
votes
1 answer

Why is 1 assigned to a hash element?

Could any one explain what this statement does in Perl $type{$_->{brand}} = 1; I could understand that the hash %type has a key brand holding the reference to another hash brand and 1 is assigned to it what does it mean??!!! when it is assigned as…
user2064238
-5
votes
1 answer

Can't use string ("") as a HASH ref while "strict refs" in use

Can't use string ("") as a HASH ref while "strict refs" in use
user9799283
-6
votes
1 answer

Printing array value from a hash in perl

I am new to perl and this thing is driving me nuts. I have a hash as below %temp = ( a_collection => [\%first, \%second] ) I want to get the array elements out as a string so i can use them as args in the loop. I have below code foreach $item…
user775093
  • 589
  • 1
  • 8
  • 21
1 2 3 4
5