spacejunky has asked for the wisdom of the Perl Monks concerning the following question:
#!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 ); } # }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding values to registry
by graff (Chancellor) on Aug 04, 2002 at 02:29 UTC | |
|
Re: Adding values to registry
by Courage (Parson) on Aug 02, 2002 at 19:19 UTC |