Hi All,
> 
> I have the following lines from a config file I am trying to read:
> {wellfleet ASN}                 .1.3.6.1.4.1.18.3
>         (agentType)             .1.3.6.1.4.1.18.3.3.1.11
>         (chassisType)           .1.3.6.1.4.1.18.3.1.1.1
>         ....
>         ....
> 
> My code is:
>     if ( $line =~ m/\{(.*)\}[\s\t]+(.*)/ ) {
>           $dev = 1;
>           $value = $2;
>           $opt = lc($1);
>           $opt =~ s/ //g;
>        } elsif ( $line =~ m/[\t\s]*\((.*)\)[\s\t]*(.*)/ ) {
>                $oid = 1;
>                $value = $2; #the OID of for this device
>                $opt = lc($1);
>                $opt =~ s/ //g;
>        } else {
>             die ("Config file is badly built"); }
Problem is: My first Regex matches the {} brackets, but the elsif either
never executes, or the regex does not match. I have tried using the
elsif in an egrep, and it does match the () in the config file, so I am
sure that I have the regex done fine.

Any comments would be most helpful.

Thanks
Hamish


-- 
Hamish Whittal          QED Technologies                Tel: +27 21 448 9291
[EMAIL PROTECTED]                                      Fax: +27 21 448 9551
                        `The' Linux Services Company    Cel: +27 82 803 5533

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

Reply via email to