perl-data-structures

    4热度

    3回答

    如果我想使用循环向mother_hash中的所有阵列添加新的散列,那么语法是什么? 我的哈希: my %mother_hash = ( 'daughter_hash1' => [ { 'e' => '-4.3', 'seq' => 'AGGCACC', 'end' => '97', 'start' => '81'

    3热度

    2回答

    我想将子程序与参数一起推入堆栈,但我无法弄清楚语法。考虑一个工作示例不带任何参数: #!/usr/bin/perl -w use strict; use warnings; sub hi { print "hi\n"; } sub hello { print "hello\n"; } sub world { print "world\n"; } my @stack; push (

    0热度

    1回答

    我已经生成了一个看起来像这样的散列。 (印刷用自卸车) $VAR1 = { 'sufia:s4655g60k' => { 'curVer' => 0, 'version.0' => { 'checksum.new' => '44d88612fea8a8f36de82e1278abb02f',

    0热度

    1回答

    我们有一个交互式脚本(脚本1),它询问IP地址并继续它的执行过程。脚本1从script2调用。 正如我们所知道的IP地址,我们想通过IP自动脚本,以便不需要手动干预 我看着Expect模块。但我无法在PRODUCTION服务器上安装该模块。 有人可以提出一种方法来解决这个问题。

    0热度

    1回答

    我得到以下功能,并不知道如何将输出放入一个变量。 sub checkFiles { # Declaration my $origDir="/home/hbo/test/chksum/"; my $tmpDir="/home/hbo/test/tmp/"; # get directory inventory opendir(DIR, $origDir); my @files = sor

    7热度

    4回答

    我有一个数组参考像下面创建从元件的组合: my $strings = [qw(a b c d)]; 欲形成的所有可能的组合,并创建阵列的阵列: my $output = [qw(qw([a],[b],[c],[d],[a,b],[a,c],[a,d],[b,c],[b,d],[c,d], [a,b,c],[a,b,d],[b,c,d],[a,b,c,d]))] 我尝试什么: foreach

    0热度

    1回答

    我想阅读一个文本文件,并做一些分裂的文件,目的是将数据添加到数据库中。 文本文件看起来像。 object-group network og-net-network-hostname-blah description blah network-object host 192.168.0.1 network-object host 192.168.0.2 network-object host

    -1热度

    2回答

    我正在写一个小的perl程序,我正在检查#start和#end的模式。议程是用开始和结束模式之间的线创建一个单独的文件。这我可以用下面的脚本来做。 #!/usr/bin/perl open(INFILE,"<","testcases") || die "Can't open file: $!"; my $binary; my $tccounter=1;

    0热度

    3回答

    我有以下数据结构: my %hash = ( 'hsa_circ_0024017|chr11:93463035-93463135+|NM_033395|KIAA1731 FORWARD' => [ { 'energy' => '-4.3', 'spacer' => 'AGGCACC', 'end' => '97', 'st

    1热度

    1回答

    我总是感到困惑或不知道如何在Perl中处理哈希。 所以现在的问题是, 考虑整个事情,我试图在下面的哈希更改密钥名称。 %new_hash的 my %hash_new = { 'customername' => 'Lee & toys', 'employee_name' => 'Checngwang', 'customer_id' => 'X82349K',