随笔分类 -  07、编程语言

摘要:1、计算以e为底的对数,我们可以直接使用log函数:my $log_e = log($value); 2、计算以10为底的对数: use POSIX qw(log10);my $log_10 = log10($value); 3、有了以上两个函数中的任何一个,那么我们就可以计算任意数的对数了,计算方 阅读全文
posted @ 2018-03-27 14:14 马踏飞燕Beautiful 阅读(454) 评论(0) 推荐(0)
摘要:0.正则匹配字典:http://www.cnblogs.com/itech/archive/2010/03/19/1689793.html 1.$/=">";重新定义字符串分隔符为“>”. 2.perl 中/ms,/msg,/gms是什么意思? 正则表达式中,//msg和//gms意思一样。 //g 阅读全文
posted @ 2018-03-01 13:59 马踏飞燕Beautiful 阅读(408) 评论(0) 推荐(0)
摘要:0,glob()函数 my @infile = glob("$indir/*.txt.gz"); #获得指定路径下的文件名,并形成列表,如果$indir为空,则自动匹配当前目录下的指定文件名 1,sprintf()函数 my $rate_CG = sprintf("%.2f",$methy_CG*1 阅读全文
posted @ 2017-07-26 14:36 马踏飞燕Beautiful 阅读(357) 评论(0) 推荐(0)
摘要:1. `command`; 使用反引号调用外部命令能够捕获其标准输出,并按行返回且每行结束处附带一个回车。反引号中的变量在编译时会被内插为其值。 2. open LIST "ls -l|"; open MORE "|more"; @list=<LIST>; print MORE @list; clo 阅读全文
posted @ 2017-07-15 17:43 马踏飞燕Beautiful 阅读(4837) 评论(0) 推荐(0)
摘要:#开头处常用模块 #!usr/bin/perl use warnings; use strict; use Getopt::Long; use File::Basename; use PerIO::gzip; #open IN,"<:gzip","$in" or die " $in:$!"; #打开 阅读全文
posted @ 2017-07-15 15:06 马踏飞燕Beautiful 阅读(1526) 评论(0) 推荐(0)
摘要:我们在linux常常用到一个程序需要加入参数,现在了解一下 perl 中的有关控制参数的模块 Getopt::Long ,比直接使用 @ARGV 的数组强大多了.我想大家知道在 Linux 中有的参数有二种形式. 长参数 –help 短参数 -h 也就是-和–的分别.–表示完整参数.-表示简化参数. 阅读全文
posted @ 2017-07-15 14:41 马踏飞燕Beautiful 阅读(377) 评论(0) 推荐(0)
摘要:http://bbs.fishc./thread-35584-1-1.html #Python好好好 操作系统:linux和mac都自带Python解释器 ->-> -> IDLE-shell命令行: dir(__builtins__) #结果中,小写单词就是内置函数bif(built-in fun 阅读全文
posted @ 2017-05-25 23:29 马踏飞燕Beautiful 阅读(488) 评论(0) 推荐(0)