How do you debug a Perl scripting ( at the compile time
error or run
time error) in Unix environment ?

Answer Posted / hemalata

For debugging perl scripting u can use
1. diagnostic modules - which can help us isolate and
understand problems with our code.

EX- use warning, use strict, use diagnostics

2.perl command line switches - u can create test programm
using the perl command line.

Ex-i) #!user/bin/perl -w
or on the command line like this

>perl -w program.plx

ii) -e = it tells the perl not to load and run a program
file but to run the text following -e as a program.

> perl -e "print \"hello World \n";"

iii)-c = stops perl from running your program instead ,al it
does is check that code can be complied as valid perl.
its a good way to quickly check that a program has no
glaring syntax errors.
> perl -ce 'print "hello,world\n";'
and so on it will available Google u can search ........
3. debugging techniques and perl de-debugger - how to remove
the problems that we've found.

Using debugger
> perl -d filename.plx

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define say() function in perl?

544


How many types of operators are used in the Perl?

585


What is automatic error handling in perl?

505


How to compare two strings in perl?

551


Why should I use the -w argument with my Perl programs?

563






What syntax is used for grep() function?

575


Differentiate use and require?

533


How do I read command-line arguments with Perl?

605


What does redo statement do in perl?

538


What is the peculiarity of returning values by subroutines in perl?

488


What is the difference between use and require in perl?

474


Explain the internal working of cgi

514


What is Perl?

563


How will you access an element of a perl array?

520


You want to connect to sql server through perl. How would you do that?

545