You could also do it with substr():
my %seen; print join '', grep { !$seen{substr($_, 0, 1)}++ } <DATA>;
In reply to Re: how to remove duplicate based on the first column value
by perlguy
in thread how to remove duplicate based on the first column value
by tariqahsan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |