my @files = qw(quotePAGE1 quotePAGE2); for @files { open IN, $_ or die "failed opening file $_, at"; $\ = "\n\n"; my $num = 0; my $chunk; while($chunk = ) { ++$num; $chunk =~ s|^/-a(\S+)[^/n]*\n|| or die "no author? file $_, chunk $num; at"; while($chunk =~ s|/-s(\S+)[^\n]*\n/-q [end of code]