#!/usr/bin/perl -w
# test program for split_vars bug in SNMP.pm
# max baker <maxbaker@users.sourceforge.net>
# 2/7/05

use SNMP;
&SNMP::loadModules("CISCO-STACK-MIB");
$SNMP::debugging=1;

my $host = 'cat3500';
my $comm = 'private'; # need the r/w
my $ver  = '2c';
my $port = '1.18';  # snmpwalk -v2c -cprivate -mCISCO-STACK-MIB cat3500 portName to pick one

my $snmp = new SNMP::Session(
                    'DestHost' => $host,
                    'Community' => $comm,
                    'Version'   => $ver,
                    'UseEnums'  => 1,
                            );
die "Can't connect.\n" unless defined $snmp;
my $e = $snmp->{ErrorStr};
die("$e\n") if $e;

# Both get and set would fail for the multi-digit IID (d.d)

my $portname = $snmp->get("portName.$port") || '';
print "Old : $portname\n";
print "setting...",$snmp->set("portName.$port",'test2'),"\n";
$portname = $snmp->get("portName.$port") || '';
print "New : $portname\n";
