my $type; if(!Win32::Lanman::NetShareCheck("\\\\10.95.206.110","\filessytem\data", \$type)) { print "Sorry, something went wrong; error: "; # get the error code print Win32::Lanman::GetLastError(); }