文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>用 IE 来浏览 perldoc

用 IE 来浏览 perldoc

时间:2007-12-28  来源:lonelyair

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);
# and \lib\pods

#print $Config{installhtmldir}, "\n";

$file = File::Spec->catfile($Config{installhtmldir}, 'lib', 'pods', split(/\:+/, $module)) . '.html' unless (-e $file);
die 'no such html' unless (-e $file);
`"F:/Program Files/Internet Explorer/IEXPLORE.EXE" $file`;

 

我加了种情况,perldoc perl是不能用IE浏览的,所以加了/lib/pods,直接去找perl.html就可以完成了.

至于pl2bat看自己的需要吧,有没有都一样的.

pl2bat perl.pl ==>perl.bat

运行:

$:perl.bat perl

相关阅读 更多 +
排行榜 更多 +
鸡生化精英安卓版

鸡生化精英安卓版

飞行射击 下载
光头火柴人安卓版

光头火柴人安卓版

飞行射击 下载
轨道射击安卓版

轨道射击安卓版

飞行射击 下载