![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PERL
yuanyuanmmm
叛逆 不羁 乖巧的矛盾体
展开
-
split汉字
第一种办法: 加载 Encode模块,前提是你需要安装这个模块例子代码:$str=decode("gb2312",$names[$index]); @chars=split(//,$str); foreach(@chars) { $char=encode("gb2312",$_); print "ONE WORD:$char/n"; }第二种办法: 中文字符是占了2原创 2009-06-05 17:09:00 · 1104 阅读 · 0 评论 -
迭代哈希
迭代哈希怎么玩啊。。。数组作为哈希表A的值,哈希表A作为另一哈希表B的值 终于搞定了。。。得记录下 #!/usr/bin/perl -w sub gettime { my $line = $_[0]; my @temptime =split(/timestamp/,$_); $temptime[1] =~s/\>//; $temptime[1] =~s/\ $te原创 2012-03-22 13:36:45 · 1070 阅读 · 0 评论 -
CAM::DBF and Date::Simple 创建DBF文件
创建DBF文件#enter:start and end date#out :DBF file # 3*3*2*2*$stylecode_num(stylecode)*(16/15 mult)*days# =36*16*$stylecode_num=576*$stylecode_num*days# ctype=1 mult16!=,ctype=2 mult16 =us原创 2009-12-31 00:09:00 · 800 阅读 · 0 评论 -
烦恼的PERL环境问题:Set up gcc environment - 3.4.5 (mingw-vista special r3)
今天突然用自己的电脑写perl处理工具,才发现自己的电脑安装个perl模块都会出很多问题,诶,头疼死了,今天都十二点了。安装模块 Date-Simple报如下错误,我搞不明白了,偶的电脑上装了visual studio,但是我不清楚环境目录应该要怎么加,perl才能认识。开始提升没有CCC编译器,于是按照它开始提示的需要 ppm install Wc..不好意思忘记了。装完之后继续安装pe原创 2009-12-31 00:03:00 · 2065 阅读 · 1 评论 -
perl-File:Find
参见:http://perldoc.perl.org/File/Find.htmlFile:Find:name use File::Find; my ($size, $dircnt, $filecnt) = (0, 0, 0); sub process { my $file = $File::Find::name; #print $file, "/n"; if (-d $fil原创 2009-12-27 22:59:00 · 2306 阅读 · 0 评论 -
基本文件操作和替换
$inputFile = "1.log";$inTestPath = "testlist";$outTestPath = "newTestList";open(INF, "$inputFile") or die("cannot open $inputFile/n");while(){ if(//.grxml$/) { chomp(); s////_/g; s/grxml$/txt/;原创 2009-10-28 23:20:00 · 529 阅读 · 2 评论 -
用perl操作注册表的一些基本函数
一 Open():语法:$object->Open($RegistryObj,$hKey); $object A part of the registry.$RegistryObj The key under the $object you want to explore. $hKey Handle of the opened key. $object:$HKEY_LOCAL_MACHINE转载 2009-10-28 21:25:00 · 902 阅读 · 0 评论 -
检查工具
#check the files in the first enter dir with the logsbase-second enter dirsub getfilenameto{ my $dir =$_[0]; print "$_[0]/n"; opendir DH, $dir or die "Cannot open $dir: $!"; @allnames=(); foreach $f原创 2009-10-28 23:15:00 · 442 阅读 · 0 评论 -
用perl实现命令行打开执行文件
#open the progress by the command line#enter:progress name#out: progress path use strict;use File::Find; our $Path="C:/Documents and Settings/All Users/「开始」菜单/程序";$progress_name=$ARGV[0];$progress原创 2009-10-28 23:42:00 · 909 阅读 · 0 评论