kp2a has asked for the wisdom of the Perl Monks concerning the following question:
problem solved - needed an extra pair of eyes to see simply mistake -
thanks!
#! /usr/bin/perl -w use strict; my $debug; my $test = $ARGV[0]; print "<$test>\n"; if($test) { my $die = 1; my @a; if($test =~ s!/!\t!) { split @a = split m/\t/,$test; print "($a[0],$a[1])\n"; $die = 0 if isip($a[0]) && ($a[1] <= 32 and $a[1] > 16); } die "updatenodes.pl networkIP/numberofbits\n" if $die; $debug = 2; } else { $debug = 15; }
results in
$ ./updatenodes.pl 10.100.20.52/24 Use of implicit split to @_ is deprecated at ./updatenodes.pl line 19. <10.100.20.52/24> Use of uninitialized value in split at ./updatenodes.pl line 19. (10.100.20.52,24)
unexpected split to @_ and unexpected uninitialized warnings - script produces correct results - I am splitting to a list (array) - earlier I had my ($ip,$mask) as my list with same results - the Friendly Manual says "In scalar context, returns the number of fields found and splits into the @_ array." - my use is in list context NOT scalar - how to get rid of unexpected warnings?
print statements were added to debug
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unexpected "Use of implicit split to @_ is deprecated"
by BrowserUk (Patriarch) on Oct 22, 2009 at 13:46 UTC | |
Re: Unexpected "Use of implicit split to @_ is deprecated"
by SuicideJunkie (Vicar) on Oct 22, 2009 at 13:48 UTC | |
by kp2a (Sexton) on Oct 22, 2009 at 14:36 UTC |
Back to
Seekers of Perl Wisdom