我正在制作一个快速而肮脏的书籍标题排列,其中标题按照货架码,然后由作者,然后按标题排列。元标签的数量可能会有所不同(按货架号,国家,然后是作者,最终标题或类别排序),并且元素的数量可能会有所不同。 我有作为排序顺序 my @Stapel = ("133 ; 101", "smith ; jones ; harrods", "The Book of Kelts") ;
保持3元标记(shelfc
我有一个Perl脚本,它将一个哈希转储到'output.txt'文件中。问题是,每次运行这个脚本时,同一个'output.txt'文件被覆盖。每次运行脚本时如何生成一个新的.txt文件,以便每次运行的结果都在单独的文件中? 我有这样的事情,现在我的Perl脚本的末尾: print Dumper(\%data);
open my $temp, '>', 'output.txt' or die $!
我试图通过使用foreach循环外部的索引键值从数据打印列。 my @col;
foreach(<DATA>){
@x = split(' ',$_);
@xz = ($x[0],$x[1],$x[2]) ;
#print "$x[0]\n"; This is working but i'm not expect this.
push(@col,@xz);
}
pri
我在Perl的初学者,我试图从“开始的Perl:柯蒂斯坡”运行这个样本例如行为 #!/perl/bin/perl
use strict;
use warnings;
use diagnostics;
my $hero = 'Ovid';
my $fool = $hero;
print "$hero isn't that much of a hero. $fool is a fool
我正在写一个代码调用有4个参数(3个散列和一个文件处理程序)的子程序。我想知道如何在子程序中访问它们。我的代码如下。 #print OUTFILE "Content of TPC file:.\n";
my $DATA_INFO = $ARGV[0];
my $OUT_DIR = $ARGV[1];
my $log= "$OUT_DIR/log1";
open(LOG1,">$log");