sub have_functions { my @funcs = (); print "detecting available functions... "; my @paths = DynaLoader::dl_findfile(qw(-lpcap)); my $libref = DynaLoader::dl_load_file($paths[0]); for my $func (@_) { my $symref = DynaLoader::dl_find_symbol($libref, $func); push @funcs, $func if defined $symref } print "ok\n"; return @funcs } ... # Check that '-lwpcap' exports 'pcap_open_live' print have_functions('pcap_open_live');