免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2576 | 回复: 6
打印 上一主题 下一主题

用 IE 来浏览 perldoc [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-26 16:05 |只看该作者 |倒序浏览
http://www.fayland.org/journal/perldoc_ie.html
转载过来的,以后看文档有色彩了,perl果真很不错,
======================================================================================================
Category: Script   Keywords: perldoc

perldoc 黑忽忽的界面浏览起来不是很方便。我一向习惯用浏览器来浏览 perldoc, 但当我安装了很多模块的时候,perldoc 的 TOC/Table Of Content 将变得很长,找一个想要的模块将要拉很长的浏览器,比较不方便。
于是写了一个简单的文件用 IE 浏览器打开模块 html 文件。


  1. #!/usr/bin/perl
  2. use strict;
  3. use Config;
  4. use File::Spec;
  5. my ($module) = @ARGV;
  6. die 'not a module' unless ($module =~ /^[\w\:]+$/);
  7. # determine it weather it is in /lib or /site/lib
  8. my $file = File::Spec->catfile($Config{installhtmldir}, 'lib', split(/\:+/, $module)) . '.html';
  9. $file = File::Spec->catfile($Config{installhtmldir}, 'site', 'lib', split(/\:+/, $module)) . '.html' unless (-e $file);
  10. # if not in /lib and site/lib, check the lib/Pod, for such as perlfunc
  11. $file = File::Spec->catfile($Config{installhtmldir}, 'lib', 'Pod', split(/\:+/, $module)) . '.html' unless (-e $file);
  12. # and /bin
  13. $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 文件

  1. pl2bat pd.pl
复制代码

最后将这个 bat 文件拖进某 PATH 目录下就可以了。
这下我们可以用


  1. pd Module::Build
复制代码

来打开 Module::Build 的 html 文件。

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2007-12-26 16:11 |只看该作者
我一直搞不懂 pl2bat 是干嘛使的。

论坛徽章:
0
3 [报告]
发表于 2007-12-26 16:22 |只看该作者

回复 #2 flw 的帖子

感觉是为了没装perl的机上用吧,
可以任意拷贝,
windows下批处理的天下嘛.

论坛徽章:
0
4 [报告]
发表于 2007-12-26 16:25 |只看该作者
原帖由 lonelyair 于 2007-12-26 16:22 发表
感觉是为了没装perl的机上用吧,
可以任意拷贝,
windows下批处理的天下嘛.



转成的bat还是需要perl的

论坛徽章:
0
5 [报告]
发表于 2007-12-26 17:27 |只看该作者

回复 #4 Nosferatu 的帖子

是啊,我的错,没有perl怎么看perldoc啊.
那这个批处理有点多余,不过可心学习下,怎么样从perl script *.pl 到 *.bat.

论坛徽章:
0
6 [报告]
发表于 2007-12-27 13:00 |只看该作者

论坛徽章:
0
7 [报告]
发表于 2007-12-31 04:45 |只看该作者
在windows里就用ActivePerl。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP