#!/usr/bin/perl use Text::Wrap; @files = sort {-M $a <=> -M $b} <*.opal.txt>; $file = shift @files; undef @files; $match = shift; @ARGV = ($file); while (<>) { chomp; tr/\x97\x94\x93\x92/-""'/; if (/[0-9]{4}/) { $gap = "\n\n".$&."\n"; } if (m/$match/i) { print $gap . wrap("\n "," ",$_)."\n"; $gap = "\n"; } }