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: Undefined subroutine &main::ipv4check_ip called at 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 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 = ""; 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"; }