7 use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
17 my ($self, $key) = @_;
18 croak "No value for get_sequence" unless $key;
20 my @cmd = split / /, "seqret -filter $key";
22 my $pid = open3(undef, \*RD, \*ERR, @cmd);
24 my $seqs = FASTA::File->new(read => \*RD);
33 # Everything was okay...
34 if (WIFEXITED($?) and not WEXITSTATUS($?)) { return $seqs }
36 elsif (WIFEXITED($?) and WEXITSTATUS($?)) {
37 carp "seqret had a problem: $?; $!";
40 # Was it stopped by an external program
41 elsif (WIFSIGNALED($?)) {
42 carp "seqret halted by external signal ".WTERMSIG($?)
45 carp "seqret suffered from a random pantwetting event"