SUMMARY: OT:Perl Script

From: Vlade (vlader@optonline.net)
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
time
> and I figure there's a good amount of shell scripting, perl guru's out
here.
>
> 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
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:48 EDT