drock has asked for the wisdom of the Perl Monks concerning the following question:
I have this code wherein I would like to determine if the number is a valid ip address. But I keep getting this error:
23.23.109.103
Undefined subroutine &main::ipv4check_ip called at number_test.pl line 15 (#1)
(F) The subroutine indicated hasn't been defined, or if it was, it has
since been undefined.
Uncaught exception from user code:
Undefined subroutine &main::ipv4check_ip called at number_test.pl line 15.
Can anyone help please! thank you!
#!/usr/local/bin/perl use strict; use warnings; use diagnostics; use Net::IPv4Addr qw( :all ); my $var = "23.23.109.103"; print "$var\n"; #if ($var =~ m/^\d+$/) { #if ($var !~ /\D/) { if ( $var = ipv4check_ip($var)) { print "your variable is a number $var\n"; } else { print "number $var is not a number\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net:Addr
by Zed_Lopez (Chaplain) on Dec 04, 2004 at 05:49 UTC | |
by drock (Beadle) on Dec 04, 2004 at 06:46 UTC | |
by Zed_Lopez (Chaplain) on Dec 07, 2004 at 02:05 UTC | |
Re: Net:Addr
by fokat (Deacon) on Dec 05, 2004 at 01:52 UTC | |
Re: Net:Addr
by Zed_Lopez (Chaplain) on Dec 07, 2004 at 02:38 UTC |
Back to
Seekers of Perl Wisdom