use strict; use FileSlurp; my @disp; foreach my $f (glob "*.htm") { print STDERR "working on $f...\n"; open (F, $f) or die "cannot open $f"; my $content = read_file($f); $content =~ s{id=(\d+)}{push(@disp, $1);$1}sieg; close(F); } print join(",", @disp), "\n";