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
How to change a directory in perl?
What is eval function in perl?
Which has the highest precedence, List or Terms? Explain?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
Show the use of sockets for the server and client side of a conversation?
How to read multi lines from a file in perl?
“Perl regular expressions match the longest string possible”. What is the name of this match?
What are arrays in perl?
Write a program that shows the distinction between child and parent process?
How to access parameters passed to a subroutine in perl?
What package you use to create a windows services?
What's the difference between /^Foo/s and /^Foo/?
What is the use of 'ne' operator?
What does localtime() do in perl?
How will you create a file in perl?