Unfortunately I'm too dumb to get it to work. In my code, when deleting a reg value (not key) the delete operation either deletes the value and returns its data, or, when the value is not in the registry the delete fails and returns a string "The system cannot find the file specified."".. by calling the FastDelete member function: # # $prevSetting= $regKey->FastDelete(1); # # which will cause all subsequent delete operations via $regKey to sim +ply return a true value if they succeed.
Can some kind monk please point out the error of my ways?
Here's a simple sample:
Those docs go on to say "This optimization is automatically done if you use delete in a void context."use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>1 ); $key = "LMachine/Software/Microsoft/Windows/CurrentVersion/SharedDlls/ +"; $value = "c:\\aaa.aaa"; # $Registry->{ $key } = { "/$value" => [ "0x0003", "REG_DWORD" ] }; $prevSetting = $Registry->FastDelete(1); $res = delete $Registry->{ $key . $value }; if( $res ) { print( "removed value $value and res is $res\n" ); } else { print( " delete failed and res is '$res'\n" ); }
In reply to TieRegistry FastDelete problem by anadem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |