perl
fdsafwagdagadg6576
这个作者很懒,什么都没留下…
展开
-
CU问题解答
下面是一些CU上的问题,用shell 现实的,这里改用perl实现1 http://bbs.chinaunix.net/thread-4068071-1-1.html#!/opt/exp/bin/perl -wopen ($fd1,"<a.txt");open ($fd2,"<b.txt");@item1=();@item2=();$length1="";while (原创 2015-08-03 14:44:08 · 646 阅读 · 0 评论 -
perl 文件/路径 读写删
example1: read from command line钻石操作符#!/opt/exp/bin/perl -wsub say { print @_,"\n";}my $file =$ARGV[0];open (my $fh, '#@a= read file to array; then while read array one by one原创 2014-01-17 17:06:26 · 1115 阅读 · 0 评论 -
perl和shell的语法不同之处
catalogue1 变量定义2 括号3 数值计算4 数值和string比较5 数组6 正则,模式识别=================将shell和perl中的很多文章都可以归并到这里,变成一篇系统性的长文eg:eq for shell is num compare, eq for perl is string compareperl: elsif (else if 比较特殊), shell:e...原创 2014-07-06 12:37:46 · 1501 阅读 · 0 评论 -
perl 总结
小括号()是给数组或者hash赋值整个hash的初始化,用小括号%hash=("foo",35,"bar","12.4");列表赋值($fred,$barney)=qw (a b c d);($fred,$barney)=@_;@line=();是置空数组,hash,list 置空都是()中括号数组下标[]对匿名列表的引用:将列表的()替换为[]:my $arr原创 2014-06-29 19:07:08 · 3261 阅读 · 0 评论 -
perl example!
example1: read from command line钻石操作符#!/opt/exp/bin/perl -wsub say { print @_,"\n";}my $file =$ARGV[0];open (my $fh, '#@a= read file to array; then while read array one by one原创 2013-03-20 14:05:31 · 2059 阅读 · 0 评论 -
同一个问题不同脚本(perl,shell,tcl)的实现
《SED 单行脚本快速参考》的 perl 实现需要处理文本时,通常我会使用sed或者awk,但我从来没有掌握它们,每次用时都得临时去查怎么使用。最近又碰到一个问题,想把一个html里面所有的css及javascript链接取出来,用sed或awk折腾了半天没有整出来,最后终于放弃了。我决定转向perl,perl是门非常强大的通用语言,但它最初诞生是用于文本处理,因此它处理文本的能力非常强原创 2015-01-20 14:00:04 · 986 阅读 · 0 评论