mhearse has asked for the wisdom of the Perl Monks concerning the following question:
#!/bin/perl while (<>) { chomp; $_ =~ (/\b^\$\b/); push @in, $1; } $prev = 'nonesuch'; @iner = grep($_ ne $prev && ($prev = $_), @in); foreach $value (@iner) { print $value,"\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parse for string, then print unique
by welchavw (Pilgrim) on Dec 16, 2003 at 04:49 UTC | |
|
Re: parse for string, then print unique
by Zaxo (Archbishop) on Dec 16, 2003 at 04:56 UTC | |
|
Re: parse for string, then print unique
by duff (Parson) on Dec 16, 2003 at 04:46 UTC | |
by mhearse (Chaplain) on Dec 16, 2003 at 04:58 UTC | |
by Roger (Parson) on Dec 16, 2003 at 05:12 UTC | |
by Abigail-II (Bishop) on Dec 16, 2003 at 09:36 UTC | |
by ysth (Canon) on Dec 16, 2003 at 19:46 UTC |