- 论坛徽章:
- 0
|
http://www.fayland.org/journal/perldoc_ie.html
转载过来的,以后看文档有色彩了,perl果真很不错,
======================================================================================================
Category: Script Keywords: perldoc
perldoc 黑忽忽的界面浏览起来不是很方便。我一向习惯用浏览器来浏览 perldoc, 但当我安装了很多模块的时候,perldoc 的 TOC/Table Of Content 将变得很长,找一个想要的模块将要拉很长的浏览器,比较不方便。
于是写了一个简单的文件用 IE 浏览器打开模块 html 文件。
- #!/usr/bin/perl
- use strict;
- use Config;
- use File::Spec;
- my ($module) = @ARGV;
- die 'not a module' unless ($module =~ /^[\w\:]+$/);
- # determine it weather it is in /lib or /site/lib
- my $file = File::Spec->catfile($Config{installhtmldir}, 'lib', split(/\:+/, $module)) . '.html';
- $file = File::Spec->catfile($Config{installhtmldir}, 'site', 'lib', split(/\:+/, $module)) . '.html' unless (-e $file);
- # if not in /lib and site/lib, check the lib/Pod, for such as perlfunc
- $file = File::Spec->catfile($Config{installhtmldir}, 'lib', 'Pod', split(/\:+/, $module)) . '.html' unless (-e $file);
- # and /bin
- $file = File::Spec->catfile($Config{installhtmldir}, 'bin', split(/\:+/, $module)) . '.html' unless (-e $file);die 'no such html' unless (-e $file);`"C:/Program Files/Internet Explorer/IEXPLORE.EXE" $file`;
复制代码
再用 pl2bat 将其转化为 bat 文件
最后将这个 bat 文件拖进某 PATH 目录下就可以了。
这下我们可以用
来打开 Module::Build 的 html 文件。 |
|