Sayed, Irfan (Irfan) wrote:
> Hi,
>  
> I have two arrays . one array contains the element which needs to be
> deleted from the secound array in which that element is already present.
>
>  
> I have tried using delete function but somehow i did not succeed.
>  
> Could somebody please help me on this
>  
> Regards
> Irfan.
>  
>
>   

my @A = qw/ A B C D E F /;
my @KILL = qw/ B C D/ ;

my %H ; $H{$_} = '' for @A;
delete $H{$_} for ( @KILL ) ;

@A = keys %H; # The order becomes random
print "@A";

Believe the list will have much better ideas...
Perhaps grep// is another option, but I have no idea about the speed.

HTH,
Mug




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to