Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

Extract unique elements of an array


$prev = 'nonesuch'
@out = grep ( $_ ne $prev && ( $prev = $_ ) , @in );