ChinaUnix.net
相关文章推荐:

perl File模块大全

1、 这个模块如此之大? 10多M? 2、 安装如此复杂? 要敲击多少次回车?

by wuxiaobo_2009 - Perl - 2012-09-21 20:33:21 阅读(1050) 回复(3)

相关讨论

模块类似shell下的mkdir的功能。 脚本如下: #!/usr/bin/perl use strict; use warnings; use file::Path qw(make_path remove_tree); make_path( '/home/sysadmin/aaa/test/bb/test', { verbose => 1, mode => 0711, } ); remove_tree( '/home/sysadmin/aaa/test', { verbose => 1, error => \my $err_list, } ); 运行脚本如下: [root@localhost crontab]# ./fi...

by huifeideluotuo - Linux文档专区 - 2008-12-29 23:46:13 阅读(872) 回复(0)

perl下的file::Find模块具有shell下的find命令的功能,下面具体看2个例子: 1,找出某个目录下面以*.old结尾的文件 #!/usr/bin/perl -w use strict; use file::Find; my $path = '/home/test/'; sub wanted { if ( -f $file::Find::name ) { if ( $file::Find::name =~ /\.old$/ ) { print "$file::Find::name\n"; } } } find( \&wanted, $path ); 2,找出某个目录下面几天前的文件 my $path ...

by huifeideluotuo - Linux文档专区 - 2008-12-12 23:39:27 阅读(637) 回复(0)

小弟在安装file::basename这个模块的时候,cpan install获取的是5.15.2中的模块,在安装的时候,提示这个模块可能不太安全,有没有什么方法安装那些稳定版本的模块呢?

by zneilnet - Perl - 2011-10-10 12:47:15 阅读(2933) 回复(2)

各位高手,我需要使用tie::file模块读取文件,然后比较文件中的某一行是否与我想要的匹配,如果匹配,输出1,不匹配输出0; 代码如下: tie(@arry,'Tie::file',$filename) or die; $i=0; foreach(@arry) { $line=/XXx/; if($arry[$i]=~$line) {print 1;} else {print 0;} $i=$i+1; } 此时却出现了问题,发现我的程序只能读取文件的第一行和最后一行,请各位高手支支招,怎样才能解决这个问题?

fileperltie读取行模块

by qianyuinsour - Perl - 2010-08-23 11:42:32 阅读(6597) 回复(11)

本帖最后由 diana_cherry 于 2012-04-24 12:37 编辑 现在有按日期记的一些日志,想做实时跟踪,用到了file:Tail模块模拟tail -f的功能, my $file=file::Tail->new(name=>"/logdir/logname.".$file_date.".log",interval=>1,maxinterval=>10,tail=>-1,reset_tail=>-1,resetafter=>600,name_changes=>\&new_file,debug=>1); resetafter The number of seconds after last change when file::Tail decides the file may have been...

by diana_cherry - Perl - 2012-04-24 12:37:27 阅读(1133) 回复(1)

RT 在google里搜来搜去也搜不出来,郁闷死了。

by clming327 - Linux系统管理 - 2010-06-23 19:03:17 阅读(1433) 回复(1)

bash-2.05# perl Makefile.PL Parsing config.in... Looks Good. Note (probably harmless): No library found for -ldb Writing Makefile for DB_file 不知此处ldb为社么库。 bash-2.05# make cp DB_file.pm blib/lib/DB_file.pm AutoSplitting blib/lib/DB_file.pm (blib/lib/auto/DB_file) cc -c -I/usr/local/BerkeleyDB/include -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEfile_SOURCE -D_file_OF...

by minmig - Solaris - 2007-08-06 22:15:32 阅读(1985) 回复(0)

bash-2.05# perl Makefile.PL\r\nParsing config.in...\r\nLooks Good.\r\nNote (probably harmless): No library found for -ldb\r\nWriting Makefile for DB_file\r\n\r\n不知此处ldb为社么库。\r\nbash-2.05# make\r\ncp DB_file.pm blib/lib/DB_file.pm\r\nAutoSplitting blib/lib/DB_file.pm (blib/lib/auto/DB_file)\r\ncc -c -I/usr/local/BerkeleyDB/include -fno-strict-aliasing -pipe -Wdeclaration-after-statement ...

by minmig - Solaris - 2007-08-06 22:15:32 阅读(3838) 回复(0)

先写一下书上的程序: #!/usr/bin/perl -w use file::Spec; $pathname=file::Spec->catfile("C","perl)","lib","CGI"; print "$pathname\n"; 但是我运行的时候出现错误, 所以我将第二句修改成 $pathname=file::Spec->catfile("C","perl","lib","CGI"); 打印出:C/perl/lib/CGI。 在注释中,关于use file::Spec;,说没有指明操作系统,所以在当前系统下加载file::Spec 但是当我指定操作系统时,use file::Spec::unix 运行得到...

by 落音 - Perl - 2009-11-04 18:00:07 阅读(2010) 回复(2)
by wallyjj - Perl - 2011-03-29 10:33:35 阅读(1127) 回复(0)