[Bioperl-l] passing $result
Andreas Kahari
ak at ebi.ac.uk
Wed Nov 12 10:12:55 EST 2003
On Wed, Nov 12, 2003 at 08:50:57AM -0600, Joshua A Udall wrote:
> Bioperl -
>
> I'm having trouble passing an object and I seem only able to pass part of
> it, the first 'layer'. I'm trying to pass $result (from blast parsing)
> into a function and access the hits but they seem to have
> disappeared. What is the correct syntax to pass $result as a whole object?
>
> while(my $result = $searchio->next_result() ) {
> while (my $hit=$result->next_hit){
> print_graph($result);
> }
> }
>
> sub print_graph {
> my $result_sub = $_[0];
> while( my $hit = $result_sub->next_hit ) {
>
> ... and do groovy stuff here with the hits
>
> }
> }
Are you sure you want to call print_graph() inside the inner
loop, looping on next_hit(), and the loop over next_hit() within
print_graph() as well?
--
| )( | Andreas Kähäri |< >|
|( )| EMBL, European Bioinformatics Institute | >< |
| )( | Wellcome Trust Genome Campus, Hinxton |< >|
|( )| Cambridge, CB10 1SD | >< |
| )( | United Kingdom |< >|
More information about the Bioperl-l
mailing list