Perl – Practical Extraction and Report Language | Pathologically Eclectic Rubbish Lister,著名的工具语言。它能够通过简短的代码做到很多别的语言需要很长代码才能干到的事情,对于日常事务特别适合。 从学校里借了本《Perl入门》,Randal L. Schwartz & Larry Wall (Perl创始人)写的。看上去很旧,原来学校里也有不少人研究这个东西啊~ 学起来需要一些时间,特别是关于正则表达式的部分…… Perl是先编译后运行的,因此速度还是比较快的。现在基本上每套类Unix系统上都有Perl。 今天发现Winamp保存的播放列表用的是\,而Unix系只认/,于是就想到写个Perl程序练练。写了一会儿,又调了一会儿,改了一会儿,达到预定目标~ #! /usr/bin/perl use File::Copy; print “Please enter file name:”; $fname = ; chop($fname); if (!open(FILEIN,”$fname”)){ die “Input file not there!”;} $fout = $fname . “.tempfile”; if (!open(FILEOUT,”> $fout”)){ die “Cannot create temp file”;} …
Continue reading ‘Useful Perl’ »