Skip to content

perl system() does what it wants (just like april in a dutch saying) #171

Description

@mmterpstra

According to perldoc you should catch all of your system calls with a check of $? if you want your programs to exit nicely if the shell gives an error. Example below.

#set -x or && could be used. Here both are used. 
my $indexcmd = "set -x && bgzip -c $invcf > $outvcf && tabix -p vcf $outvcf";
        my $ret = `$indexcmd`;
        $? == 0 or die "system cmd `$indexcmd` failed: $ret\n exit code: $?";

Example of affected scripts (not exhaustive ):

  • createBWAandSAMtoolsIndices.pl
  • per_folder/index_creator.pl
  • createLocalRealignmentIntervals.pl
  • runpindel.pl
  • maybe every perl script that contains system().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions