perl
风语者666
这个作者很懒,什么都没留下…
展开
-
perl里面的位运算
无论是 & (位与),|(位非,注意不是‘||’),还是 >>(右移),原创 2023-05-05 23:27:53 · 193 阅读 · 1 评论 -
Perl 捕获子进程错误
【代码】Perl 捕获子进程错误。原创 2023-01-01 23:03:24 · 204 阅读 · 0 评论 -
perl语言哈希的一个诡异之处
也就是说,如果你嵌套判断哈希的key,则上一层的key会自动被生成。原创 2022-07-21 01:27:48 · 67 阅读 · 0 评论 -
perl里面变量的defined与TRUE
#!/usr/bin/perl -wuse strict;my ($a,$b,$c,$d) = (1,2,"");if($c){print "\$c is true\n";}if(defined $c){print "\$c is defined\n";}if($d){print "\$d is true\n";}if(defined $d){print "\$d is defined\n";}原创 2022-01-10 19:00:45 · 259 阅读 · 0 评论 -
自己写的检测cis/trans的脚本
/mnt/lustre/user/wubin/01.Program/Scripts/01.script/GeneLab/check_EGFR_790_797.pl#!/usr/bin/perl -wuse strict;use Getopt::Long;my ($read_len, $chr, $pos1, $ref1, $alt1, $pos2, $ref2, $alt2);my $usage =<<qq;perl $0 /mnt/lustre/user/wubin/03.原创 2021-09-03 22:13:48 · 317 阅读 · 0 评论 -
perl hash中嵌套数组的一些操作
#!/usr/bin/perl -wuse strict;#以下这三个可以挨个试试#my %Sample = ('China'=>[14,960]);#my %Sample = ('China'=>[]);my %Sample = ();#my %data = ('google'=>'google.com', 'runoob'=>'runoob.com', 'taobao'=>'taobao.com');foreach my $i(@{$Sample{'Ch.原创 2021-07-30 15:19:53 · 652 阅读 · 0 评论 -
perl里面hash的一个问题
#!/usr/bin/perl -wmy %hash = ();#这三行是错的,不会起作用save_in_array($hash{'China'}{'Area'}, 960);save_in_array($hash{'China'}{'Area'}, 1300);save_in_array($hash{'China'}{'Area'}, 1350);#这三行才是对的save_in_array(\@{$hash{'China'}{'Area'}}, 960);save_in_array(.原创 2021-07-23 08:07:52 · 98 阅读 · 0 评论 -
在perl程序运行前修改@INC
如果要设定一个模块的搜索路径,又不想在“~/.bashrc”中去永久性的添加一行 “PERL5LIB”。那可以在脚本中直接修改@INC;#!/usr/bin/perl -wuse strict;use File::Basename;use Cwd;use lib '/mnt/lustre/user/wubin/01.Program/Scripts/01.script/GeneLab';use Common;my $common = bless {}, 'Common';=pod这.原创 2021-07-22 16:39:42 · 991 阅读 · 0 评论 -
用perl模块修改hash值
建立一个perl模块Test.pm#!/usr/bin/perl -wpackage Test;require Exporter;use strict;use warnings;use File::Basename;our @ISA = qw(Exporter);our @EXPORT = qw(parseChoose parseinterval parseconfig creatSubDir processTumorNorm getCanerType);our @version =原创 2021-07-21 16:07:24 · 215 阅读 · 0 评论 -
perl Spreadsheet::ParseXLSX包里面的识别合并单元格
my $parser_batch = &getparser($file_batch);my $workbook_batch = $parser_batch->parse($file_batch);my $h2p = Lingua::Han::PinYin->new(capitalize => 1);if ( !defined $workbook_batch ) { die $parser_batch->error(), ".\n";}#这是X...原创 2021-07-20 09:10:40 · 881 阅读 · 0 评论 -
perl的包
Perl包bless原创 2021-06-25 13:01:53 · 548 阅读 · 0 评论 -
perl里面的split
#!/usr/bin/perl -wuse strict;my $a = ':'."China:Japan";my $b = (split /:/,$a)[0];if($b){print "b not_null\n";}if(defined $b){print "b defined\n";}print "=======================\n";my $c = ':'."China:Japan".":";my $d = (split /:/,$c)[-1];if(.原创 2021-06-08 23:01:41 · 660 阅读 · 0 评论 -
perl保存数据结构
转自:http://blog.chinaunix.net/uid-20727529-id-766600.html原创 2021-06-07 23:59:07 · 353 阅读 · 2 评论 -
perl里面的%ENV
建立一个a.pl#!/usr/bin/perl -wuse strict;my $a = 'China';$ENV{'country'} = $a;exec("perl b.pl");#system("perl b.pl");print "KKKKKK\n";建立一个b.pl原创 2021-06-03 10:55:34 · 810 阅读 · 0 评论 -
perl 哈希的一个问题
#!/usr/bin/perl -wuse strict;my %hash = ();$hash{('A','B')} = ['C','D']; #这样没问题#$hash{('A','B')} = ('C','D'); #这样是错的原创 2021-02-04 14:21:42 · 63 阅读 · 0 评论