使用perldoc检查您的模块POD

Perl附带一个名为perldoc的命令行程序,它可以更容易地在POD标记语言中搜索和阅读Perl的大量文档。如果使用-F标志调用perldoc,它将显示输入文件的POD标记,这在您正在开发新的Perl发行版并希望在CPAN上供所有人查看之前检查模块中的POD外观时非常有用。

# Pass a local file to perldoc

perldoc -F ProxyManager.pm

这将显示POD标记

ProxyManager(3)                                            

NAME
       Net::OpenVPN::ProxyManager - connect to proxy servers using OpenVPN.

SYNOPSIS
       use Net::OpenVPN::ProxyManager;
       my $pm = Net::OpenVPN::ProxyManager->new;

       # Create a config object to capture proxy server details
       my $config_object = $pm->create_config({remote => '100.120.3.34 53', proto => 'udp'});

       # Launch OpenVPN and connect to the proxy
       $pm->connect($config_object);
       # do some stuff

       # Disconnect from the proxy server
       $pm->disconnect();

DESCRIPTION
       Net::OpenVPN::ProxyManager is an object oriented module that provides methods to simplify the management of proxy connections that support OpenVPN.

This is a base generic class, see Net::OpenVPN::ProxyManager::HMA for additional methods to interact with hidemyass.com proxy servers.

METHODS
   new
       The constructor accepts an anonymous hash for two optional parameters: config_path and warning_flag. config_path is the path that ProxyManager.pm will use to create the config file when the create_config method is called. By default config_path is set to '/tmp/openvpn-config.conf'.


这篇文章最初发布在PerlTricks.com上。

标签

David Farrell

David是一位专业程序员,他经常推文博客关于代码和编程艺术。

浏览他们的文章

反馈

这篇文章有什么问题吗?请在GitHub上打开一个问题或拉取请求来帮助我们。