03 2012 档案

perl中heredoc
摘要:在成块打印文本的时候特别有用。格式print <<EOFyou text go hereEOFsub usage{ print <<EOF;Usage: test.pl -c config, -f file -l lines -c config file -f file name -l number of linesEOF}NOTE: the last EOF must start at the beginning of the line!!!you can use other words instead of EOF 阅读全文

posted @ 2012-03-30 10:08 perlman 阅读(1029) 评论(0) 推荐(0) 编辑

在shell帮助文档中搜索内容
摘要:比如想查看ls的-l参数,可以先 man ls,然后再/-l即可。和vi中的搜索一样。 阅读全文

posted @ 2012-03-30 09:45 perlman 阅读(630) 评论(0) 推荐(0) 编辑

perl正则表达式返回多个匹配
摘要:返回()中的文本。方法一:sub test { my $text = '(zdd)(autumn)(123)(456)'; while ($text =~ /\((.*?)\)/g) { print $1, "\n"; }}方法二:sub test1 { my $text = '(zdd)(autumn)(123)(456)'; my @matches = ($text =~ /\((.*?)\)/g) ; foreach my $match (@matches) { print $match, "\n"; }}== 阅读全文

posted @ 2012-03-26 15:16 perlman 阅读(7294) 评论(0) 推荐(0) 编辑

Vim正则表达式
摘要:== 阅读全文

posted @ 2012-03-14 14:38 perlman 阅读(229) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示