my $count = 0; Net::Pcap::loop($object, -1, \&syn_packets, '$count++') || die 'Unable to perform packet capture'; print "$count";