Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to escape space in registry path?

by marto (Chancellor)
on Nov 20, 2012 at 13:02 UTC ( #1004711=note: print w/ replies, xml ) Need Help??


in reply to How to escape space in registry path?

The examples you posted won't work, each lacks a string terminator (no closing "). The crude example below works for me where there is a space in the key name.

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Win32::TieRegistry( Delimiter => '/' ); my $value = $Registry->{ "HKEY_CURRENT_USER/Software/Microsoft/Windows +/CurrentVersion/Group Policy" } ; print Dumper $value;


Comment on Re: How to escape space in registry path?
Download Code
Re^2: How to escape space in registry path?
by anaconda_wly (Scribe) on Nov 20, 2012 at 15:29 UTC
    Thanks for your quick response. I double checked my code, I made mistake when paste code to the post, but not in my original code. I tried your keys, it works for me either. I tried many different keys, all works but all keys under "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Updates", including several keys like:"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Updates/UpdateExeVolatile", no space in it; "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Updates/Windows Server 2003". I don't know why...I refreshed and didn't work. Apparently it's not related to the white space.
      I don't know why

      If you want to know why, then reporting $^E upon failure is the best next step.

      - tye        

        The $^E says "The system could not find the environment option that was entered."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2014-10-30 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (206 votes), past polls