[Omaha.pm] debugger question

Jay Hannah jay at jays.net
Thu Jan 18 18:20:46 PST 2007


On Jan 18, 2007, at 9:36 AM, kiran bina wrote:
> Hi Jay,
> The output from the debugger is as below. How can I see the value of 
> $result and $Query_name ?
> Thanks
> kiran
>
> main::(second_step.pl:43):      while ( my $result = 
> $searchio->next_result() )
> main::(second_step.pl:44):      {
>   DB<3> n
> main::(second_step.pl:47):          my $Query_name= 
> $result->query_name();
>   DB<3> p $result;
> Bio::Search::Result::BlastResult=HASH(0x8d5e140)
>   DB<4> p $Query_name;
> Use of uninitialized value in print at (eval 
> 16)[/usr/share/perl/5.8/perl5db.pl:628] line 2, <GEN1> line 20.

$result is an object, so you can't "print" it per-say, you have to call 
methods on the object. In the debugger you can usually see the guts 
iniside an object using "x", so

    x $result

might show you interesting things.

On the $Query_name front you haven't yet executed the line of code that 
will (probably) populate $Query_name, so the debugger gets unhappy. 
$Query_name doesn't exist until 1 line of code later. So if you move 
past that line of code

    n

and then print $Query_name

    p $Query_name

you might have something in there.  Welcome to the fray, brave Perl 
debugger!!  :)

HTH,

j



More information about the Omaha-pm mailing list