Tuesday, October 27, 2015

How to Remove Array Value in Perl


my @arr = ('1','2','3','4','5');
my $ele_remove = 5;
@arr = grep { $_ != $ele_remove } @arr;
print @arr;