#!/usr/bin/perl use strict; use warnings; my @A1= qw/0 1 6 2 3 7 4 5/; my @A2= qw/6 7/; my %hash = map {$_ => 1}@A2; @A1 = grep {!defined $hash{$_}}@A1; print "@A1\n"; #prints: 0 1 2 3 4 5
In reply to Re: removing elements in array in perl
by Marshall
in thread removing elements in array in perl
by t-rex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |