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 );
34 # Everything was okay...
35 if ( WIFEXITED($?) and not WEXITSTATUS($?) ) { return $seqs }
38 elsif ( WIFEXITED($?) and WEXITSTATUS($?) ) {
39 carp "seqret had a problem: $?; $!";
43 # Was it stopped by an external program
44 elsif ( WIFSIGNALED($?) ) {
45 carp "seqret halted by external signal " . WTERMSIG($?);
47 carp "seqret suffered from a random pantwetting event";