小编use*_*599的帖子

在另一个perl脚本中打印perl脚本?

嗨,我是stackoverflow的新手.我已经尝试过在不同的perl脚本中打印另一个perl脚本的方法,我遇到的唯一建议是使用反斜杠转义变量...但我尝试了这个并且它不起作用.

我的目标是编写一个perl脚本来制作一堆新的perl脚本,但因为它不允许我在print""中使用变量/数组/等.有没有解决的办法?提前致谢!

这是我的初步脚本:

    #!/usr/bin/perl
    use warnings;
    use strict;

    my $idfile = $ARGV[0];
    open (IDFILE,'<',$idfile)
    or die "Could not open $idfile \n";

    my $outfile_name;
    my $outfile = $outfile_name."pl";
    open (OUTFILE, '>', $outfile)
    or die "Could not open $outfile \n";

    while (my $line = <IDFILE>) {
        chomp ($line);
        if ($line =~ /(T4-GC_[0-9]+)/) {
            my $outfile_name = "Pull_".$line;
            my $script = "
    #!/usr/bin/perl
    use warnings;
    use strict;
    use Bio::SearchIO;
    use Bio::SeqIO;

    my @ARGV = glob("*.fa");

    foreach my $fil (@ARGV) {
        my $seqio  = …
Run Code Online (Sandbox Code Playgroud)

printing perl nested

1
推荐指数
1
解决办法
210
查看次数

标签 统计

nested ×1

perl ×1

printing ×1