in reply to regexp problem - extract all but last part of SNMP OID
$oidfila =~ s/^[0-9\.]+(\.[0-9]+)$//;
This is already a good start, but you're matching - and thus substituting - too much. Leave off the first part and things will be ok:
$oidfila =~ s/\.[0-9]+$//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regexp problem - extract all but last part of SNMP OID
by kennethk (Abbot) on Nov 21, 2011 at 17:06 UTC | |
by hbm (Hermit) on Nov 21, 2011 at 19:18 UTC |