in reply to counting syn+ack. Help!!!

Net::Pcap::loop($object, -1, \&syn_packets, '$count++') ||

The 4th parameter to Net::Pcap::loop()'$count++' — is what's being passed as argument to the callback function, i.e. what you get as $user_data in syn_packets() (which you don't even use there). So I'm not really sure what this is meant to achieve.

If you want to count how many times the callback function is being called, it's probably better to place $count++ (without quotes) in the body of that function.