in reply to Trouble getting the file contents from return values
The two values you are returning are simply the names of those files, and not actually the contents. You are setting $out1 and $out2 as the name you want for the output files, then telling clustalw2 to use those names for the output files, but you're missing the step where you read those files into your program.
You can do something like the following before you return (note: untested code):
my ($result1, $result2); { local $/; open my $fh1, "<", $out1 or die "Could not open $out1: $!"; $result1 = <$fh1>; open my $fh2, "<", $out2 or die "Could not open $out2: $!"; $result2 = <$fh2>; } return ($result1, $result2);
As a side note, I'm a little confused by some of the things you are doing. Firstly, what is the point of if ($contig1 =~ m/contig1$/)? Don't you already know that $contig1 ends with "contig1", since you set it at the beginning of the sub? Secondly, you never use the $contig*_out variables. Did you mean to do something with them?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trouble getting the file contents from return values
by lomSpace (Scribe) on Jun 12, 2009 at 13:41 UTC |