in reply to Removing recurring consecutive element
I am sure that there is a more elegant way of doing it, but this works.sub get_alphb_fr_tpl { my $aref = shift; my @str = grep (!/[\d+\s+]/,map{ split " ",$_} @{$tpl}) ; my $lst = ''; my @out; for(@str){ $out[@out] = $_ unless $lst eq $_; $lst = $_; } print Dumper \@out ; return; }
|
|---|