#!/usr/bin/perl use Net::IP; my $ip = new Net::IP('192.168.0/24') or die(Net::IP::Error()); #Usage() if (@ARGV != 0 and $ARGV[0] eq "-h"); sub get_hosts{ return new Net::IP($_[0]->last_ip())->intip() - $_[0]->intip(); } print get_hosts($ip)."\n"; # Berechnung des ld() print log(get_hosts($ip))/log(2); # Lange schreibweise, vllt stimmt ja an der Funktion was nicht print log((new Net::IP($ip->last_ip())->intip()) - ($ip->intip()));