use Win32::TieRegisry ( Delimiter=>"/" ); my ($key); if ($configUser || Win32::IsWin95()) { $key = 'CUser/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders//Programs'; } else { $key = 'LMachine/SOFTWARE/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders//Common Programs'; } my $folderdir = $Registry->{$key};