Dot "." is the "match-all" character in a regex so your split won't return anything.
Actually split returns a lot of things, it's just that the way list assignment works there is nothing left to put in the array. If you make a slight change you can see everything that split returns:
$ perl -le'my $ip="158.21.17.45"; my @values = split(".", $ip, -1); pr +int $ip,"\t\t",$#values,"\n";' 158.21.17.45 12
In reply to Re^2: does split(".") work?
by jwkrahn
in thread does split(".") work?
by dtd1941
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |