open FILE, "<file.html"; @tables; while (<FILE>) { chomp; if (/<td>(.*)<\/td>/){ push @tables, $1; } } close FILE;