Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Removing recurring consecutive element

by neosamuri (Friar)
on Oct 13, 2005 at 07:20 UTC ( [id://499796]=note: print w/replies, xml ) Need Help??


in reply to Removing recurring consecutive element

You could do something like this:
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; }
I am sure that there is a more elegant way of doing it, but this works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://499796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-28 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found