Why cant I break here in Perl Debugger?

S

Sara

I often want to break on the first line of a block, such as


21 while ($itsANiceDay)
22 {print "lets play outdoors\n";
23 $itsANiceDay = getWeatherReport();
24 }


I can set a breakpoint on like 21 or 23, but why not 22? It looks like
a legitimate place to break?

G

(sorry about posting this in the middle of another thread it was accidental.
 
A

Anno Siegel

Sara said:
I often want to break on the first line of a block, such as


21 while ($itsANiceDay)
22 {print "lets play outdoors\n";
23 $itsANiceDay = getWeatherReport();
24 }


I can set a breakpoint on like 21 or 23, but why not 22? It looks like
a legitimate place to break?

G

(sorry about posting this in the middle of another thread it was accidental.

See my answer there.

Anno
 
B

Bill Smith

Sara said:
I often want to break on the first line of a block, such as


21 while ($itsANiceDay)
22 {print "lets play outdoors\n";
23 $itsANiceDay = getWeatherReport();
24 }


I can set a breakpoint on like 21 or 23, but why not 22? It looks like
a legitimate place to break.


I have found the debugger to much more reliable on code that conforms to
all the conventions (and examples) in perldoc perlstyle. Your example
breaks as expected after it is rearranged into the following style:

21 while ($itsANiceDay){
22 print "lets play outdoors\n";
23 $itsANiceDay = getWeatherReport();
24 }

I do not know if this is a general rule, but I have always been able to
work around similar problems this way.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top