[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how do i debug in perl on a winnt platform?

Posted on 2000-05-10
5
Medium Priority
?
224 Views
Last Modified: 2010-03-05
i have just downloaded the latest release of perl, and i as understand it there is a debugger built into it.  i am running winnt 4.0 service pack 5.  i thought i could just enter the -d switch after i run perl and i would be able to debug.  but this didn't work.  please help.
0
Comment
Question by:krella
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:geotiger
ID: 2798198
perl -d

or

#!/usr/local/bin/perl -d

0
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 2798216
The built in Perl debugger is only text based, you run it by starting an MS-DOS window and typing :
perl -d your_script.pl.

If you want to pay money, ActiveState make a developer kit with a windows based visual debugger built in: http://www.activestate.com/pdk/ 

0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2798484
perl -w yourScript.pl

suits me the best. I know it is not a debugger. but, it surely gives a lot of warnings I need.
0
 
LVL 8

Expert Comment

by:shlomoy
ID: 2798969
perl -wc your_perl_script.pl

issues both warnings and compile messages.
0
 
LVL 16

Accepted Solution

by:
maneshr earned 400 total points
ID: 2800330
krella,

this might not be the exact solution you are looking for but its a viable one all the same.

i would suggest you use a debugging variable in your program.
this variable (lets day $debug) would have only two possible values 0 & 1.

when $debug has the value 0, debugging mode is off.
when $debug has the value 1, debugging mode is on.

when the debug mode is on, debugging message would be printed on your standard output (screen or browser window) and you can track the progress of your script.

here is a small example.

#!/usr/local/bin/perl

$debug=0;

$salary="100000";
$tax_pct=".2";


print "Salary is $salary \n" if $debug;
print "Tax percent is $tax_pct \n" if $debug;

$tax_amt=$salary * $tax_pct;

print "Tax amount is $tax_amt\n";

===========

try this script as is & see the output.

Next make the value of $debug to 1 and then see the output.

this solution is totally protable and not dependent on any external tool!!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question