Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种在 Perl 中从 UNC 路径获取服务器名称的方法,当它采用以下任一格式时:
$unc = '//server.domain.com/share';
$unc = '\\\\server.domain.com\\share';
for my $unc ('//server.domain.com/share', '\\\\server.domain.com\\share') { my ($server) = $unc =~ m{([^/\\]+)}; print $server, "\n"; }
输出
server.domain.com server.domain.com