PerlElvir
Technical User
- Aug 23, 2005
- 68
Hi all,
I want to ask can I erase duplicate elements and make new array without that old elements.
example:
@ins= ("ace","name","ace","car");
@outs= ("2","3");
foreach $var1 (0 .. $#ins)
{
foreach $var2 (0 .. $#outs)
{
$buffer = $outs[$var2]."----".$ins[$var1];
print $buffer."\n";
push(@new_array,$buffer)
}
}
now I get:
2----ace
3----ace
2----name
3----name
2----ace
3----ace
2----car
3----car
so can I erase
2----ace
3----ace
and to get in @new_array:
2----ace
3----ace
2----name
3----name
2----car
3----car
I want to ask can I erase duplicate elements and make new array without that old elements.
example:
@ins= ("ace","name","ace","car");
@outs= ("2","3");
foreach $var1 (0 .. $#ins)
{
foreach $var2 (0 .. $#outs)
{
$buffer = $outs[$var2]."----".$ins[$var1];
print $buffer."\n";
push(@new_array,$buffer)
}
}
now I get:
2----ace
3----ace
2----name
3----name
2----ace
3----ace
2----car
3----car
so can I erase
2----ace
3----ace
and to get in @new_array:
2----ace
3----ace
2----name
3----name
2----car
3----car