On Tue, 21 Aug 2001, Herman Cremer wrote:

> Hi
> I have a string from a snmp get function...
> 
> interfaces.ifTable.ifEntry.ifInOctets.4 = 954819405
> 
> how can I "CUT" so the value is only 954819405 ?

with a regular expression.

  $string =~ s/.* = //;

would be one way to do it.

Another way would be

$string =~ m/ = (\d+)/;
my $value = $1;


which could be better written as:

my ($value) = ($string =~ m/ = (\d+)/);


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();



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

Reply via email to