sub scan_installed { system ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s > temp_instal.txt'); open (INSTAL, "<", 'temp_instal.txt') or die "Couldn't open temp_instal.txt for reading: $!\n"; while () { if (/DisplayName\s+REG_SZ\s+(.+)/) { push (@installed, $1."\n") unless $1 =~ /Windows XP|KB[0-90-90-9]/; } } close(INSTAL); system ('del temp_instal.txt'); }