I'm trying to add a value to an existing subkey. I tried what was posted when I searched but did not work. Is there something that I overlooked in my code.
#!perl -w # DESCRIPTION # perl script: Finds the repo version number from the *snapshot.snp fi +le. # # --- # main( ) # { #use Win32::TieRegistry; use Win32::TieRegistry ( Delimiter=>"/" ); $PVFDRepo = "c:\\content\\PV\\FD\\PVFDRepoSnapshot.snp"; $FCFDRepo = "c:\\content\\FC\\FD\\FCFDRepoSnapshot.snp"; $RepoFile = "c:\\content\\RepoFile.txt"; $keyFed = $Registry->{"HKEY_LOCAL_MACHINE/SOFTWARE/AACTS/2001/Cont +ent Build/Federal Compliance"}; $keyGlobal = $Registry->{"HKEY_LOCAL_MACHINE/SOFTWARE/AACTS/2001/C +ontent Build/Global Provision"}; for( $count=1; $count<=2; $count++ ) { $found = 0; if( $count eq 1 ) { $Filename = $PVFDRepo; $TagName = "Global Provision"; $key = $keyGlobal; } else { $Filename = $FCFDRepo; $TagName = "Federal Compliance"; $key = $keyFed; } open( FILE, "<$Filename" ) || die "can't open file $Filename: +$!\n"; @filelines = <FILE>; foreach $fileline( @filelines ) { chop( $fileline ); if( $fileline =~ "<repo_version>(.*)</repo_version>" && $ +found eq 0 ) { $key{'/Repo Version'} = "$1"; $found = 1; } } close( FILE ); } # }

In reply to Adding values to registry by spacejunky

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.