perl -pi'.orig' -e 'BEGIN {open(FH,"alt_tag_file"); @alltags = ; chomp @alltags;}; @tags = @alltags unless(scalar(@tags)); s/(]+>)/@T = ($1,$2); $T[0].($T[1] =~ m,\balt=, ? "" : q{ alt="}.shift(@tags).q{"}).$T[1]/eg *.html *.htm *.shtml