Wim De Hul wrote: > > Hey folks, Hello,
> I'm writen a script to manage my router configuration. > To get the IOS version I use regular expressions. > First, I did it with: > > $_ = &getparameter($sysdescr_mib,"System description"); # Get > the SysDescr via SNMP > /Version /; > $_ = $'; > (/, /); > $swversion = $`; > > But this is not the way I want it to do... I like to have more > "professional" code. > Is there a way to do it in one line (probably there is)? > > I tried with: > > $_ = &snmpget($sysdescr); > $IOS_version = /Version (.*?)\, /i; > > When I do now: print "$1\n"; I get the IOS version > But when I type print "$IOS_version\n"; It displays just 1... > Can I get rid of the S_? my $IOS_version = $1 if snmpget( $sysdescr ) =~ /Version\s+([^,]+),/i; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]