#!/usr/bin/env perl # # allcharstwice - print the lines on which each character occurs exactly twice # # $Id$ # # Example of use: words -x * | grep '[aeiuo']' | uniqer | allcharstwice use warnings; use strict; while (<>) { /\S.*\S/ or next; my %occ; map { ++$occ{$_} } split( //, $& ); if ( !grep { $_ ne 2 } values %occ ) { print; } }