List,

I have a problem where I need a while loop to go through a config file
change the remote IP address every time it finds it.  There is blank
line after each cfg part.  I also need it to check to make sure that the
data always starts with...

Tunnel Name,
IP tunnel
Remote IP

I suppose I would do some thing like the following....

sub read_config() {
        open CFGFILE, "<$cfg";
        while ($line=<STDIN>) {
                chomp $line;
                @line=split(/=/, $line);
                $config{$line[0]}=$line[1];

                #If the blocks do not follow rules like Tunnel Name then
die with error <--- but how would I go aboout doing this?
                
        }
        close CFGFILE;
}

 

Config file....

Tunnel Name, Test1
IP tunnel,192.168.0.1
Remote IP,150.101.1.1

Tunnel Name, Test2
IP tunnel,192.168.0.6
Remote IP,150.101.1.6

==============================
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email:  [EMAIL PROTECTED]
WWW:    http://www.vintek.net
Tel:    (08) 8523 5035
Fax:    (08) 8523 2104
Snail:  P.O. Box 312
        Gawler   SA   5118
==============================


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to