Hi
I was able to manage some thing like below .
Still not able to achieve the desired ...
#!/usr/bin/perl
my %hash;
$ServerIP,$FireWallIP;
print "Please Enter ServerIP ";
chomp ( $ServerIP = <STDIN> );
print "Please Enter FireWallIP ";
chomp ( $FireWallIP = <STDIN> );
$filename = "/sampleprogs/perlscripts/TestConfig.cfg";
open ( FILE,'<', $filename) or die "Cannot open file: $!";
$hash{'ServerIP'} = 'ServerIP';
$hash{'FireWallIP'} = 'FireWallIP';
while (my($ServerIP,$ServerIP)=each(%hash) ) {
chomp;
s/#.*//; # no comments
s/^\s+//; # no leading white
s/\s+$//; # no trailing white
next unless length; # anything left?
my($ServerIP,$ServerIP) =split /
/, $_;
$FILE{$ServerIP} = join '=<>', @value;
#print$ ServerIP;
#print$FireWallIP;
}
close FILE;