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
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