here is the idea:<br>I want to delete the keys and values from a hash<br>( the keys are elements of an array)<br>and when i use this code- it runs and deletes only the first element of the hash<br>here is the code<br><br>sub del_elementt{<br>$art=$formdata{'element'};<br>@array=split /,/,$art;<br><br>open (TEMP, "/temp.txt"
¦¦&error;<br>@a_file=<TEMP>;<br>close (TEMP);<br>foreach $f(@a_file){<br> @arr=split '=',$f;<br> $key=$arr[1];<br> $rez=join('=',$arr[0],$arr[2]);<br> $my_hash{$key}=$rez;<br> }<br>foreach $key(@array){<br> delete $my_hash{$key};<br>}<br><br>and it tells me that only the first element is deleted<br>when i try to use the exists funtion it tells me that only <br>the first element exist<br>but when i put the second element first it is deleted<br><br>help pls <br>i spend 2 days and a night <br>about solving this problem <br> thank you <br>