How to debug in Perl?

Source: Internet
Author: User

If It is a small program, you can use the this to:

c:\rebecca\script\perl>perl-d calculate.pl

Loading DB routines from perl5db.pl version 1.39_10

Editor support available.

Enter h or ' h ' for help, or ' Perldoc perldebug ' for morehelp.

Main::(Calculate.pl:3): my 1 = 10;

Db<1> 1= 3 #you can change the number here

db<2> n #press N to execute next command

Main::(calculate.pl:4): my 2 = 6;

Db<2> Print1 # But you can see it didn ' twork

10

Db<3> 1= 3 #change It again here, it willwork!!

db<4> print1 #see, it worked.

3

db<5> N

Main::(calculate.pl:5): My $sum = 1 + 2;

Db<5> Print2

6

db<6> = 1 # I wanted to the change number2 aswell, but I just type number by mistake ....

db<7> N

Main::(calculate.pl:7): print $sum, "\ n";

Db<7> Print$sum

9

db<8> q #quit the debug now

How to debug in Perl?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.