SUMMARY: OT:Perl Script

From: Vlade <>
Date: Mon Aug 19 2002 - 10:32:14 EDT
I want to thank everyone who responed (20 responses, too may to thank
individually). Got exactly what I was looking for with the following:

$myquery="interfaces.ifTable.ifEntry.ifOutErrors.3 = 2066577";
($name, $value) = split(/ = /,$myquery);

from David Meissner. I can't believe it was that simple.

Original post:
> Sorry for the off topic post, but this has been evading me for quite some
> and I figure there's a good amount of shell scripting, perl guru's out
> I've got a simple regular expression matching question I can't figure
> out.
> I'm using SNMP to get interface info. I'm trying to store the results
> in a database but I need to put the output in a variable.The string
> looks like this:
> $myquery="interfaces.ifTable.ifEntry.ifOutErrors.3 = 2066577";
>  I want to put the value 2066577 into a variable. How would I go about
> getting that value into $value for example in terms of $myquery?
> If someone has a suggestion in either perl(preferable) or sh I would be
> appreciative.
> Thanks
sunmanagers mailing list
Received on Mon Aug 19 10:39:23 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:52 EST