LustyLearner
Programmer
Hi there,
I am a new B to the perl programming. I just started it just coule of days ago. I am just trying to understand few basic debugging concepts and i am running into problems.
Here is the program i am using for my testing:
********* program begin****************
#!/usr/bin/perl -w
# Author: Learner
# Copyright 2004.
#
# This program demonstrates the Perl debugger.
use strict;
looper();
sub looper {
my $arg = 0;
while ($arg < 10) {
++$arg;
}
}
**********program End*****************
The problem with debugging commands are a (action) and b (breakpoints).
When i try as below:
C:\Perl\Assignment3>perl -d testDebugger.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
main:
testDebugger.pl:8): looper();
DB<1> v
5 # This program demonstrates the Perl debugger.
6: use strict;
7
8==> looper();
9
10 sub looper {
11: my $arg = 0;
12: while ($arg < 10) {
13: ++$arg;
14 }
DB<1> a 12 print "arg is now $arg... "
DB<2> b 12 ($arg > 8)
DB<3> c
i am expecting result which looks like
********************Begin Expected result*******************
arg is now 0... arg is now 0... arg is now 1... arg is now 1... arg is now 2...
arg is now 2... arg is now 3... arg is now 3... arg is now 4... arg is now 4...
arg is now 5... arg is now 5... arg is now 6... arg is now 6... arg is now 7...
arg is now 7... arg is now 8... arg is now 8... main::looper(testDebugger.pl:12)
: while ($arg < 10) {
DB<3> ow 9...
******************************End of expected result*******
But instead of this i am getting some thing different ... i dont' know what exactly it is but i can paste down here.
************** begin of my program output*******************
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
Use of uninitialized value in concatenation (.) or string at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 1.
at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 1
eval '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; print "arg is now $arg... ";
;' called at D:/Perl/lib/perl5db.pl line 628
DB::eval called at D:/Perl/lib/perl5db.pl line 2127
DB:
B called at D:/Perl/lib/perl5db.pl line 9421
DB::fake::at_exit() called at D:/Perl/lib/perl5db.pl line 8993
DB::END() called at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 0
eval {...} called at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 0
DB<3> arg is now 0... arg is now ...
**************End of my program out put*********************
I don't understand what exactly it means. I am not sure if i am missing some thing here. Please help me out what should i do.
Thanks in advance.
Learner
I am a new B to the perl programming. I just started it just coule of days ago. I am just trying to understand few basic debugging concepts and i am running into problems.
Here is the program i am using for my testing:
********* program begin****************
#!/usr/bin/perl -w
# Author: Learner
# Copyright 2004.
#
# This program demonstrates the Perl debugger.
use strict;
looper();
sub looper {
my $arg = 0;
while ($arg < 10) {
++$arg;
}
}
**********program End*****************
The problem with debugging commands are a (action) and b (breakpoints).
When i try as below:
C:\Perl\Assignment3>perl -d testDebugger.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
main:
DB<1> v
5 # This program demonstrates the Perl debugger.
6: use strict;
7
8==> looper();
9
10 sub looper {
11: my $arg = 0;
12: while ($arg < 10) {
13: ++$arg;
14 }
DB<1> a 12 print "arg is now $arg... "
DB<2> b 12 ($arg > 8)
DB<3> c
i am expecting result which looks like
********************Begin Expected result*******************
arg is now 0... arg is now 0... arg is now 1... arg is now 1... arg is now 2...
arg is now 2... arg is now 3... arg is now 3... arg is now 4... arg is now 4...
arg is now 5... arg is now 5... arg is now 6... arg is now 6... arg is now 7...
arg is now 7... arg is now 8... arg is now 8... main::looper(testDebugger.pl:12)
: while ($arg < 10) {
DB<3> ow 9...
******************************End of expected result*******
But instead of this i am getting some thing different ... i dont' know what exactly it is but i can paste down here.
************** begin of my program output*******************
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
Use of uninitialized value in concatenation (.) or string at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 1.
at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 1
eval '($@, $!, $^E, $,, $/, $\\, $^W) = @saved;package main; print "arg is now $arg... ";
;' called at D:/Perl/lib/perl5db.pl line 628
DB::eval called at D:/Perl/lib/perl5db.pl line 2127
DB:
DB::fake::at_exit() called at D:/Perl/lib/perl5db.pl line 8993
DB::END() called at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 0
eval {...} called at (eval 8)[D:/Perl/lib/perl5db.pl:628] line 0
DB<3> arg is now 0... arg is now ...
**************End of my program out put*********************
I don't understand what exactly it means. I am not sure if i am missing some thing here. Please help me out what should i do.
Thanks in advance.
Learner