perl
joshua_lzh
这个作者很懒,什么都没留下…
展开
-
perl shift
use strict;use warnings;use utf8;my @city = ("tokyo", "osaka");print "array-->:\n";for (my $i = 0; $i原创 2011-01-08 10:44:27 · 99 阅读 · 0 评论 -
Perl取得系统日期
($sec,$min,$hour,$mday,$mon,$year)=localtime(time);$mon++;$mon="0$mon"if ($mon原创 2011-01-08 13:30:08 · 141 阅读 · 0 评论 -
Perl几个巧妙代码的分析
如下文本:122334455667想要得到的结果:1223344556671perl -pe "chomp if $.%2" file2perl -pe "chomp; $_.=" file3perl -lpe "$\=--$|?$,:$/" file第一种解释比较好理解,奇数行chomp去掉“\n”;...原创 2011-01-08 13:48:59 · 241 阅读 · 0 评论 -
Perl去除数组中重复元素的两段代码
#!/usr/bin/perluse warnings;use strict;use DBI;my @array = ( 'a', 'b', 'c', 'a', 'd', 1, 2, 5, 1, 5 );my %saw;my @out=grep(!$saw{$_}++,@array);print "@out\n";原创 2011-01-08 16:59:07 · 253 阅读 · 0 评论 -
grep命令大练习
grep命令练习文件:datafileSteve Blenheim:238-923-7366:95 Latham Lane, Easton, PA 83755:11/12/56:20300Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500Igor Chevsky:385-375-839...原创 2011-01-11 20:16:34 · 213 阅读 · 0 评论 -
shell 案例之数据库求和,整除
1.用shell求出从1至100的累加和echo |awk '{for (i=1;i原创 2011-01-12 18:48:22 · 232 阅读 · 0 评论 -
hbase filter
new ValueFilter( CompareOp.LESS, new BinaryComparator(Bytes.toBytes("a")));new QualifierFilter( CompareOp.NOT_EQUAL, new BinaryPrefixComparator(Bytes.toBytes("Column")));...原创 2011-02-23 21:07:23 · 109 阅读 · 0 评论