in reply to delete multiple occurrences

hi, try out this one.
@a = (1,9,3,4,5,6,7,2,4,3); @b = ("x","y","z","z","a","z","z","z","b","c"); @a=reverse(@a); @b=reverse(@b); foreach $l(0 .. scalar @a){ $next=$b[$l+1]; $next1=$b[$l+2]; if($next ne $b[$l]){ push(@c,$a[$l]); } } print reverse @c;