Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What construct should I be using if this is depreciated ?

Status
Not open for further replies.

sumncguy

IS-IT--Management
Joined
May 22, 2006
Messages
118
Location
US

Not sure what else I should be using. This is the 21st line of the perl code


$mod =~ split(/ /, $mod);


The error :
Use of implicit split to @_ is deprecated at c2 line 21.

The cheap G new guy code (some stuff
intentionally missing) :
#! /usr/local/bin/perl -w
use lib '/tools/perl/arch';
use lib '/tools/perl/lib';
use Socket;
use Sys::Hostname;
my $SNMPG = "/usr/local/bin/snmpbulkget";
#
if ($#ARGV != 2) { &err ;}
#
open(IPL, "$ARGV[0]") if (-e $ARGV[0]) || die;
$cs = "$ARGV[1]";
#
while($ip = <IPL>) {
chomp($ip);
@VER = map {split(/\$/, `snmpwalk -v2c -c $cs -Os $ip 1.3.6.1.4.1.9.9.25.1.1.1.2.5 2>&1`)}[];
@MOD = map {split(/\./, `snmpwalk -v2c -c $cs -Os $ip sysObjectID 2>&1`)}[];
@NAM = map {split(/\./, `snmpwalk -v2c -c $cs -Os $ip sysName 2>&1`)}[];
$NAM[1] =~ s/.*STRING: //g;
$VER[1] =~ s/,//g;
$mod = pop(@MOD);
$mod =~ split(/ /, $mod);
chomp($mod);
print "$ip\t$NAM[1]\t$mod\t$VER[1]\n";
}#end while
 
Code:
$mod [red]=[/red] split(/ /, $mod);

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 


Sheeez ... details details .. sorry and thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top