in reply to Re^2: NetDB - Problem with perl module NET:MAC:Vendors
in thread NetDB - Problem with perl module NET:MAC:Vendors

Meh - looking ath the source code of Net::MAC::Vendors, it seems that its documentation is simply wrong:

... sub load_cache { my( $source, $dest ) = @_; my $data = do {; if( defined $source ) { unless( -e $source ) { carp "Net::Mac::Vendor cache source [$source] does not + exist"; return; } do { local( @ARGV, $/ ) = $source; <> } } else { __PACKAGE__->ua->get( oui_url() )->res->body; } }; ...

Try simply passing a plain filename to it:

Net::MAC::Vendor::load_cache("/opt/netdb/netmacvendor/oui.txt");

Also, opening a bug report here might help :-)

Replies are listed 'Best First'.
Re^4: NetDB - Problem with perl module NET:MAC:Vendors
by Vict0rC (Initiate) on Oct 12, 2015 at 19:58 UTC
    You are right!!! Docu is wrong! But... still no luck at all :( without file:// it shows no error, but still not translating...
    #!/usr/bin/perl use strict; use Net::MAC::Vendor; Net::MAC::Vendor::load_cache("/opt/netdb/netmacvendor/oui.txt"); # Vendor code lookup my $winmac = "90:2b:34:38:44:0d"; my $vendor_ref = Net::MAC::Vendor::fetch_oui_from_cache( $winmac ); print "Vendor is: $vendor_ref \n"

    This outputs nothing...

    I am using http://standards.ieee.org/regauth/oui/oui.txt

Re^4: NetDB - Problem with perl module NET:MAC:Vendors
by Vict0rC (Initiate) on Oct 14, 2015 at 19:50 UTC

    I opened issue at authors github page here https://github.com/briandfoy/net-mac-vendor/issues/8 And also tried many other test, with perlbrew and different perl and cpan versions, to test if there isnt some incompatibility issue... But no luck. Still no output from fetch_oui_from_cache

    Is there any way to test, if load_cache function works? If it really loads the cache from file? Thanks for help.