...

View Full Version : How to change hash value for a particular Key?



MetalGear
02-26-2010, 07:23 AM
Hello all,

I have a query, is there any way to change value of a particular key in hash?



my %unique;
$j = 1;
$unique[$ftype[$k] = "j"
for($i=0;$i<$length;$i++)
{
if(($i+1)<$length)
{
if($ftype[$i] eq ($ftype[$i+1]))
{
$j++;
$unique{$ftype[$k]} = "$j"; ##Here I am trying to assign new value
}
if($ftype[$i] ne ($ftype[$i+1]))
{
$j = 1;
$unique{$ftype[$i+1]} = "$j";
}
}
}


based on certain conditions, I am trying to edit the hash key's value,
but it is returning 1, Which I am assigning to the key when it is created.

Please help me,
Thanks

MetalGear
02-26-2010, 09:09 AM
My mistake, some variable was manipulated.
This code does work.

please delete if required

Hello all,

I have a query, is there any way to change value of a particular key in hash?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum