in reply to get NIC slot

ethtool appears to do what you want. Maybe you can check the code and port the useful stuff to Perl.