in reply to Win32 registry export

Parse::Win32Registry looks interesting

Replies are listed 'Best First'.
Re^2: Win32 registry export
by wwe (Friar) on Jun 17, 2010 at 08:29 UTC
    I checked this module already. This is only for processing native binary registry files like SYSTEM.DAT. After re-reading the docs according to your advice I found an interesting function "as_regedit_export". It looks like what I'm looking for. At the moment I'm trying to adapt this function for my code.
      First of all thank you Anonymous Monk. You advise pointed me to the right direction. At the moment I'm able to get the output in a format of regedit.exe tool. There is only one problem: the tool writes the files as Unicode UTF-16LE with byte-order-marks (BOM). There is no problem to write a file in unicode and also the BOM sequence came up very fast:
      open my $fh, '>:encoding(UTF-16LE)', 'wwe-perl.reg'; print {$fh} "\x{FEFF}"; print {$fh} "Windows Registry Editor Version 5.00\n\n"; say {$fh} "[HKLM\\SOFTWARE\\WWE]"; close $fh;
      But I'm stuck with a problem I can't find a solution: every end of line has a byte sequence of "00 0D 00 0A" at regedit output and "00 0D 0A 00" at my script output. I don't know what is wrong and how to change this. With the current output I the file looks like a number of Chinese characters. Everything works fine if don't add "\n" to my output (the editor displays the string "Windows Registry Editor Version 5.00" and Unicode BOM as file format. Thank you for any help!
        Check your layers
        print "layers ", PerlIO::get_layers($fh), "\n";
        You probably need raw
        open my $fh, '>:raw:encoding(....
        See PerlIO and related docs for more