neversaint has asked for the wisdom of the Perl Monks concerning the following question:
Such that it gives:use Data::Dumper; my $tpl = ['A -4 B','B -4 C','C -4 A','A -4 B']; get_alphb_fr_tpl($tpl); sub get_alphb_fr_tpl { my $aref = shift; my @str = grep (!/[\d+\s+]/,map{ split " ",$_} @{$aref}) ; print Dumper \@str ; return; }
Instead of:$VAR1 = ['A','B','C','A','B'];
$VAR1 = ['A','B','B','C','C','A','A','B'];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing recurring consecutive element
by Skeeve (Parson) on Oct 13, 2005 at 07:06 UTC | |
by neversaint (Deacon) on Oct 13, 2005 at 07:13 UTC | |
by monkfan (Curate) on Oct 13, 2005 at 07:22 UTC | |
|
Re: Removing recurring consecutive element
by neosamuri (Friar) on Oct 13, 2005 at 07:20 UTC | |
|
Re: Removing recurring consecutive element
by skillet-thief (Friar) on Oct 13, 2005 at 07:30 UTC | |
|
Re: Removing recurring consecutive element
by Perl Mouse (Chaplain) on Oct 13, 2005 at 08:53 UTC |