由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - perl 高手看过来
相关主题
unix下运行perl输出.txt文件高人帮我看看一个简单的script,为什么nohup有问题?
Linux下如何限制一个命令只能在登陆为指定用户下才能运行?请问mpirun怎么放在后台运行?
Perl问题求助我的home server
Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away&! 什么意思?
how to count a pattern in vi?编写支持CGI的web服务器大致原理
ORZ, 2.6.31.2-stable 有136个patch./test input and ./test < input
Valgrind报uninitialized value was created by a heap allocation发包子 echo 求助
纠结死了, 到底是用 GB2312 还是 UTF8 存中文文件名呢Urgent help please! background process killed.
相关话题的讨论汇总
话题: stdin话题: line话题: use话题: patch2html
进入Linux版参与讨论
1 (共1页)
l*******G
发帖数: 1191
1
想要把程序的patch 转成html 格式,这样code 的前后变化一目了然,便于交流,
却找不到合适的工具,
找到了一个patch2html.pl
http://david.decotigny.free.fr/snippets/patch2html.pl
下载后,运行却出错,程序很短,这里全贴出来,高手们试一试,看能否解决。(我想
很可能是程序经http下载后个别特殊字符出了问题。
错误信息如下:
Name "main::FH" used only once: possible typo at
patch2html.pl line 312.
Use of uninitialized value $string in substitution (s///)patch2html.pl line 71, line 2.
Use of uninitialized value $string in substitution (s///) patch2html.pl line 76, line 2.
---原程序 -------------------------
t*****g
发帖数: 1275
2
那些问号是什么?是不是下载的时候编码没搞对?utf/iso字符搞乱了?

line 71, line 2.

【在 l*******G 的大作中提到】
: 想要把程序的patch 转成html 格式,这样code 的前后变化一目了然,便于交流,
: 却找不到合适的工具,
: 找到了一个patch2html.pl
: http://david.decotigny.free.fr/snippets/patch2html.pl
: 下载后,运行却出错,程序很短,这里全贴出来,高手们试一试,看能否解决。(我想
: 很可能是程序经http下载后个别特殊字符出了问题。
: 错误信息如下:
: Name "main::FH" used only once: possible typo at
: patch2html.pl line 312.
: Use of uninitialized value $string in substitution (s///)patch2html.pl line 71, line 2.

l*******G
发帖数: 1191
3

是一个特殊符号,
用vi 看的结果是 §
确实很奇怪,还有就是Code 中的空格或者tab 建都有可能丢失了
C********s
发帖数: 120
4
Looks like you ran the program like this:
patch2html.pl some.html
while you should run it like this:
patch2html.pl It readds the input from STDIN, not a file name
m*********g
发帖数: 273
5
To read this kind of PERL is a tough job.
l*******G
发帖数: 1191
6
I have changed the code slightly by removing the strange characters, which should be either / or &
And also I thought it should be executed like:
Firstly generate the patch:
diff code1.c code2.c > patchfile
Then run the code:
chmod a+x patch2html_new.pl
patch2html_new.pl patchfile > output.html
Now it is complaining like this:
======================
./patch2html_new.pl patchfile
Use of uninitialized value $string in substitution (s///) at ./patch2html_
new.pl line 73, line 1.
Use of un
C********s
发帖数: 120
7
faint, still don't see the "main" is only one line at the end of the script??
dodiff_stdin();
if read input from the STDIN, not a file name, so you need to run it like
this:
patch2html.pl
l*******G
发帖数: 1191
8
Good,
Also did a little search and found it's most relevant successor:
http://www.freebsd.org/cgi/cvsweb.cgi/projects/cvsweb/cvsweb.cgi?rev=1.297;content-type=text%2Fplain
where most of the parts are written into the infamous cvsweb program
http://www.freebsd.org/projects/cvsweb.html (latest version)
http://www.freebsd.org/cgi/cvsweb.cgi/www/en/cgi/cvsweb.cgi (old version)
I'm not interested in cvsweb or any cgi application here. Hopefully with the
two codes to compare about, I can finally make
1 (共1页)
进入Linux版参与讨论
相关主题
Urgent help please! background process killed.how to count a pattern in vi?
请教个简单命令问题ORZ, 2.6.31.2-stable 有136个patch
一个简单的bash脚本怎么写?Valgrind报uninitialized value was created by a heap allocation
用mutt如何保证安全? 纠结死了, 到底是用 GB2312 还是 UTF8 存中文文件名呢
unix下运行perl输出.txt文件高人帮我看看一个简单的script,为什么nohup有问题?
Linux下如何限制一个命令只能在登陆为指定用户下才能运行?请问mpirun怎么放在后台运行?
Perl问题求助我的home server
Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away&! 什么意思?
相关话题的讨论汇总
话题: stdin话题: line话题: use话题: patch2html