Perl Debugger: DBD::mysql::db do failed: MySQL server has gone away at

2013-07-30 Thread mimic...@gmail.com
In my script, I previous connected and disconnected to the database within
every subroutine. Now I have made changes and it now connect/disconnect to
mysql only once  within main:: (at the start and end of script
respectively). Although my script works fine, I am wondering whether this
is the best way.

I'm not very familiar with the debugger, but I tried it and it reported
MySQL has gone away and then it stopped. I expected the debugger to go
through all the subroutines within the script, but it doesn't. Does the
output of the debugger point to a problem? As said the script behaves as
expected when I run it.


$ perl -dT usermap.cgi

Loading DB routines from perl5db.pl version 1.32
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(usermap.cgi:23): my $session = initialise_session();
  DB1 c
Set-Cookie: token_id=75cf9b9da31cf21ce755a3a6971049e2; path=/
Date: Sun, 28 Jul 2013 02:54:37 GMT
Content-Type: text/html; charset=ISO-8859-1

Don't know what to do here. Did you pass any parameter?
 at usermap.cgi line 107
DBD::mysql::db do failed: MySQL server has gone away at
/usr/local/share/perl5/CGI/Session/Driver/mysql.pm line 50.
 at /usr/local/share/perl5/CGI/Session/Driver/mysql.pm line 50

CGI::Session::Driver::mysql::store('CGI::Session::Driver::mysql=HASH(0x3499de0)',
'75cf9b9da31cf21ce755a3a6971049e2', '$D = {\'_SESSION_ETIME\' =
7200,\'_SESSION_ID\' = \'75cf9b9...') called at
/usr/local/share/perl5/CGI/Session.pm line 251
CGI::Session::flush('CGI::Session=HASH(0x2036e90)') called at
/usr/local/share/perl5/CGI/Session.pm line 92
CGI::Session::DESTROY('CGI::Session=HASH(0x2036e90)') called at
usermap.cgi line 129
eval {...} called at usermap.cgi line 129
(in cleanup) DBD::mysql::db do failed: MySQL server has gone away
at /usr/local/share/perl5/CGI/Session/Driver/mysql.pm line 50.
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.
  DB1 w
Adding a watch-expression requires an expression
  DB1


excerpt from my code.

 48 my $dbh = db_connect();

107 die Don't know what to do here. Did you pass any parameter?\n;
108 }


22 $dbh-do(qq{UPDATE user SET login_status = 'N' WHERE login_status = 'Y'
AND last_active  DATE_SUB(CURRENT_TIMESTAMP,INTERVAL $log_in_time2live
MINUTE)}) ||
123 warn Couldn't update database table user:$DBI::errstr\n;
124
125
126 $dbh-disconnect;
127
128
129 exit 0;


Thanks

Mimi


In the debugger, how do I repeat a command n times?

2012-04-25 Thread Nathan Trapuzzano
Some GDB commands (e.g. step) take a numerical argument n that tells
the debugger to repeat the command n times. Does the perl debugger have
a similar feature?

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: In the debugger, how do I repeat a command n times?

2012-04-25 Thread Shlomi Fish
On Wed, 25 Apr 2012 09:36:10 -0400
Nathan Trapuzzano nbt...@nbtrap.com wrote:

 Some GDB commands (e.g. step) take a numerical argument n that tells
 the debugger to repeat the command n times. Does the perl debugger have
 a similar feature?
 

One option would be to do source $filename (where $filename is the name of
the file) and this contains these commands N times. That's the easiest way I
can think of, but there may be others.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Parody of The Fountainhead - http://shlom.in/towtf

Linux — Because Software Problems Should not Cost Money.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




FW: New Build for AIX Fails in debugger

2009-03-10 Thread Chuck Lyon
Hello,

I'm hoping someone can help me identify the problem I'm encountering with a
new PERL built with gcc on an AIX box. (I'd also appreciate any help in
redirecting the request, if appropriate - TIA)  The symptoms are that the
debugger doesn't seem to be able to find the source code of the main
program.  It cannot list, or set a breakpoint.  The ability to view
variables with x seems hit-or-miss.  I've included the basic info from the
build.

Any help will be much appreciated.

Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
  Platform:
osname=aix, osvers=5.3.0.0, archname=aix
uname='aix mpadmin 3 5 00c62c5f4c00 '
config_args='-de -Dcc=gcc'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='gcc -maix32', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE
-D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe
-D_LARGE_FILES',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe'
ccversion='', gccversion='4.2.0', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='gcc -maix32', ldflags =' -Wl,-brtl -Wl,-bdynamic -L/usr/local/lib
-Wl,-b32 -Wl,-bmaxdata:0x8000'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc -lbsd
perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc -lbsd
libc=, so=a, useshrplib=false, libperl=libperl.a
gnulibc_version=''
  Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Xlinker
-bE:/usr/local/lib/perl5/5.8.9/aix/CORE/perl.exp'
cccdlflags=' ', lddlflags='  -Wl,-bhalt:4 -Wl,-G
-Wl,-bI:$(PERL_INC)/perl.exp -Wl,-bE:$(BASEEXT).exp -Wl,-bnoentry -lc -lm
-L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_MALLOC_WRAP USE_FAST_STDIO USE_LARGE_FILES
USE_PERLIO
  Built under aix
  Compiled at Mar  9 2009 15:51:26
  @INC:
/usr/local/lib/perl5/5.8.9/aix
/usr/local/lib/perl5/5.8.9
/usr/local/lib/perl5/site_perl/5.8.9/aix
/usr/local/lib/perl5/site_perl/5.8.9
.
#



-- End of Forwarded Message


Debugger start problem

2008-11-18 Thread craig
I added a -d to the first (bang) line of a Perl program I've been  
running
for years, because I wanted to look at how it's been acting funny  
lately.


This was what I got when I tired to start the program:

--
dual-1-25:/Documents/Ours/logs/bin $ ./list_db_all../to_excel/ 
exc1081103.txt


Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(./list_db_all:56):   our $bigpack = 'dI'.FIXED_CTS.'d'.CELLS_PER;
Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The  
COLUMNS and LINES environment variables didn't work. The resize  
program didn't work. at /System/Library/Perl/Extras/5.8.8/darwin- 
thread-multi-2level/Term/ReadKey.pm line 362.
Compilation failed in require at /Library/Perl/5.8.6/Term/ReadLine/ 
Perl.pm line 63.

 at /Library/Perl/5.8.6/Term/ReadLine/Perl.pm line 63
	Term::ReadLine::Perl::new('Term::ReadLine', 'perldb', 'GLOB 
(0x811ef4)', 'GLOB(0x812b9c)') called at /System/Library/Perl/5.8.8/ 
perl5db.pl line 6029

DB::setterm called at /System/Library/Perl/5.8.8/perl5db.pl line 2203
DB::DB called at ./list_db_all line 56
Debugged program terminated.  Use q to quit or R to restart,
---

The line 56 that is referenced is the first Perl statement in the  
program,

other than comments and use (particularly use constant).

To me it looks like Perl is a bit funged up.

Does anyone have any suggestions how to unfung it?

Thanks for being there,
Craig MacKenna


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-04 Thread Telemachus
On Tue Nov 04 2008 @  4:11, Rob Dixon wrote:
  Rob Dixon wrote:
 If I had things my way there would never be any use of Perl as a command-line
 tool. 

Isn't this throwing out the baby with the bathwater? Here's a random, real,
recent example of why I'm not giving up Perl on the command line. I
had to reformat a computer at work and as always I put a bunch of
personal Perl scripts into $HOME/bin. The versions I had saved started with
#!/usr/bin/perl, but I wanted them to use #!/usr/local/bin/perl (5.10 with
added modules rather than Apple's default, system-wide version of 5.8.x).

Why write, save and run a 10 line script when I can simply do this?
perl -i.bak -pe 's{/usr/bin/perl}{/usr/local/bin/perl}' *

You write as though our only options are portraying Perl as a command-line
tool or never using it on the command line. I think that there's a lot of
middle ground. (All of that said, I'm writing this email using vim  mutt,
notwithstanding all the Apple-y gui goodness at my command. So, maybe I'm
weird.)

T

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-04 Thread Jenda Krynicky
From: Rob Dixon [EMAIL PROTECTED]
 I have said several times that the shortcut behaviour of the logical operators
 is ugly and unfamilar to non-Unix users (yes, I know C does it, but that is a
 deficiency) 

Beg your pardon??? Or maybe ... what exactly do you mean by shortcut 
behaviour?

You mean you would expect and even, god forbid, want the language to 
evaluate all expressions even if the result is already known the way 
the bloody braindead Visual Basic does in

 While Not rstFoo.EOF and rstFoo.Fields(Section).Value = 1

I do hope not!


 and I can think of no excuse at all for naming the function 'grep'.

Agreed in this one.

 If I had things my way there would never be any use of Perl as a command-line
 tool. To use it as one is to clip its wings and invite the prejudice of the 
 many
 platforms where that simply will not work.

Again, beg your pardon? There's nothing forcing you to use Perl as a 
command-line tool. I don't see how could the POSIBILITY of using 
something in some special way (apart from all the other ways you can 
use it) clip its wings. Preventing that use could.

 A lot of work has gone into porting
 historical behaviour to most conceivable hosts, in particular the fabrication 
 of
 a 'fork' call where no such native concept exists. Also -w has been superseded
 with 'use warnings', but nothing is so far in place to represent the -n and -p
 qualifiers, and they must be considered a legacy.

-n is

LINE:
while () {
... # your program goes here
}

-p is

LINE:
while () {
... # your program goes here
} continue {
print or die -p destination: $!\n;
}

how is there nothing in place to represent it?
 
 There is no reason any more to write Perl programs on the command line, and 
 the
 sooner we stop trying to force it to be a utility the quicker the world will
 adopt it as a language.

There is a lot of reasons and there is no relation between Perl being 
also a command line utility and its adoption as a language.

I do not use Perl like that too often, but I do not see any reason to 
have to write the two statements I need to run into a file so that I 
coud pass them to perl for execution.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-04 Thread Sharan Basappa
 My final comment is that $temp is an awful name for a variable under almost 
 any
 circumstances.

I do agree. More often than not, if I dont have a meaningful name for
a variable it is mainly because the
problem and solution are not worked out clearly in mind.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




debugger exiting

2008-11-03 Thread Sharan Basappa
Hi,

I am using debugging for a program of mine.

The debugger exits probably after a regex match fail. I am not sure
why it should exit.
Any ideas, clues?

Regards

main::(StTrAuto.pl:106):  my @new_auto_tr = ();
  DB2 s
main::(StTrAuto.pl:107):  foreach $temp (@auto_tr)
main::(StTrAuto.pl:108):  {
  DB2 s
main::(StTrAuto.pl:109):if($temp =~ m/^$start_state)/)
main::(StTrAuto.pl:110):{
  DB2 s
Unmatched ) in regex; marked by -- HERE in m/^0) -- HERE / at
StTrAuto.pl line 109.
 at StTrAuto.pl line 109
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-03 Thread John W. Krahn

Sharan Basappa wrote:

Hi,


Hello,


I am using debugging for a program of mine.

The debugger exits probably after a regex match fail. I am not sure
why it should exit.
Any ideas, clues?

Regards

main::(StTrAuto.pl:106):  my @new_auto_tr = ();
  DB2 s
main::(StTrAuto.pl:107):  foreach $temp (@auto_tr)
main::(StTrAuto.pl:108):  {
  DB2 s
main::(StTrAuto.pl:109):if($temp =~ m/^$start_state)/)
main::(StTrAuto.pl:110):{
  DB2 s
Unmatched ) in regex; marked by -- HERE in m/^0) -- HERE / at

  ^
The reason is that you have a right parenthesis without a left 
parenthesis to the left of it.  Parentheses are special is a regular 
expression so to match a literal parenthesis you have to put a backslash 
in front of it like: \)


perldoc perldiag
[ snip ]
unmatched ( in regex; marked by -- HERE in m/%s/
(F) Unbackslashed parentheses must always be balanced in regular
expressions. If you’re a vi user, the % key is valuable for
finding the matching parenthesis. The -- HERE shows in the
regular expression about where the problem was discovered. See
perlre.


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.-- Larry Wall


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-03 Thread Rob Dixon
Sharan Basappa wrote:
 
 I am using debugging for a program of mine.
 
 The debugger exits probably after a regex match fail. I am not sure
 why it should exit.
 Any ideas, clues?
 
 Regards
 
 main::(StTrAuto.pl:106):  my @new_auto_tr = ();
   DB2 s
 main::(StTrAuto.pl:107):  foreach $temp (@auto_tr)
 main::(StTrAuto.pl:108):  {
   DB2 s
 main::(StTrAuto.pl:109):if($temp =~ m/^$start_state)/)
 main::(StTrAuto.pl:110):{
   DB2 s
 Unmatched ) in regex; marked by -- HERE in m/^0) -- HERE / at
 StTrAuto.pl line 109.
  at StTrAuto.pl line 109
 Debugged program terminated.  Use q to quit or R to restart,
   use O inhibit_exit to avoid stopping after program termination,

The error is delayed until run time because you have a variable interpolated
into your regular expression.

  m/^$start_state)/

Your debugger has said, Unmatched ) in regex, and although there would have
been no error if $start_state had an open parenthesis to match the literal one
in your regex, I think it's much more likely that you meant

  m/^$start_state$/

or even better

  if ($temp eq $start_state) {
:
  }


I also think that you have not written

  use strict;
  use warnings;

at the start of your program, and anything that is presented to this list should
at least have those in place.

My final comment is that $temp is an awful name for a variable under almost any
circumstances.

HTH,

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger exiting

2008-11-03 Thread Rob Dixon
Chas. Owens wrote:
 Rob Dixon wrote:

 I also think that you have not written

  use strict;
  use warnings;

 at the start of your program, and anything that is presented to this list 
 should
 at least have those in place.
 
 Just because I am in a grumpy/contrary mood, I take issue with that
 statement.  Perl is not just a programming language; it is also a
 command line tool.  There is no reason to say
 perl -Mstrict -wnle 'print $1 if /foo=([^]*)' file_of_records
 when
 perl -nle 'print $1 if /foo=([^]*)/' file_of_records
 will do; however, I do agree that any script should definitely use the
 strict and warnings pragmas.  Of course, I haven't seen a
 Perl-as-a-command-line-tool question in a long time, so I am just
 being grumpy.

Contrary is fine Chas, and here is my view.

I think portraying Perl as a command-line tool limits it to fewer platforms than
we would like to see it ported to. In particular the quoting standards for an -e
script vary widely, and I tire of seeing people publish scripts here that will
work only as a Unix shell command line.

I have said several times that the shortcut behaviour of the logical operators
is ugly and unfamilar to non-Unix users (yes, I know C does it, but that is a
deficiency) and I can think of no excuse at all for naming the function 'grep'.
I have also seen far too many questions about 'how can I reduce this algorithm
to a single statement?' Golf aside, there is no reason to reduce any Perl
program to a minimal byte count.

If I had things my way there would never be any use of Perl as a command-line
tool. To use it as one is to clip its wings and invite the prejudice of the many
platforms where that simply will not work. A lot of work has gone into porting
historical behaviour to most conceivable hosts, in particular the fabrication of
a 'fork' call where no such native concept exists. Also -w has been superseded
with 'use warnings', but nothing is so far in place to represent the -n and -p
qualifiers, and they must be considered a legacy.

There is no reason any more to write Perl programs on the command line, and the
sooner we stop trying to force it to be a utility the quicker the world will
adopt it as a language.

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Pipe print output into shell in debugger

2008-07-28 Thread Marek
On Jul 28, 1:27 am, [EMAIL PROTECTED] (Richard Lee) wrote:


 I am sure there are other ways to do this but I always wonder how to get
 this done.
 Many research and I found that I could have |  (pipe) precede your
 command and output will go to your pager.
 I am just not sure how to change the pager on my system(mine is less,
 and if you can change to vi, you should be able to save it).

 Let me know if you are able to change your pager.. (I am not sure if
 pager they mean editor or something else in your environment, I use bash ).

Thank you Richard for your reply!

Your suggestion does not work :-( Probably I did not understand you? I
am working with tcsh on Macintosh and a little example of my attempts
to apply your suggestion are looking as follows:


marekste% perl -d excel_autorech.pl

Loading DB routines from perl5db.pl version 1.3
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(excel_autorech.pl:38):   my ( $start_day, $start_month, $year )
=
main::(excel_autorech.pl:39): ( 14, 7, 2008 );#without leading
0 please!
DB1 s
main::(excel_autorech.pl:40):   my @last_numbers = ( 56993,0,
77265,2, 3464, 2638, 84,1 );
DB1 c 287
main::(excel_autorech.pl:287):  print OUT \n x ( 29 - $last_row );
DB2 |
syntax error at (eval 42)[/usr/local/lib/perl5/5.10.0/perl5db.pl:638]
line 2, near ;
|

DB2 | print OUT \n x ( 29 - $last_row );
DB3 print OUT \n x ( 29 - $last_row ); |
syntax error at (eval 44)[/usr/local/lib/perl5/5.10.0/perl5db.pl:638]
line 2, near ; |

DB4 print OUT \n x ( 29 - $last_row ); | more
syntax error at (eval 49)[/usr/local/lib/perl5/5.10.0/perl5db.pl:638]
line 2, near ; |

Did I understand something wrong?


best greetings from Munich


marek


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Pipe print output into shell in debugger

2008-07-27 Thread Marek
Hello all,


while being in the debugger, how do I pipe all printings going to a
OUTputfile like:

print OUT text text text;

into the shell?

I read perldebug and perldebguts, but probably I just overread it?


Thank you for your help



marek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Pipe print output into shell in debugger

2008-07-27 Thread Richard Lee

Marek wrote:

Hello all,


while being in the debugger, how do I pipe all printings going to a
OUTputfile like:

print OUT text text text;

into the shell?

I read perldebug and perldebguts, but probably I just overread it?


Thank you for your help



marek


  
I am sure there are other ways to do this but I always wonder how to get 
this done.
Many research and I found that I could have |  (pipe) precede your 
command and output will go to your pager.
I am just not sure how to change the pager on my system(mine is less, 
and if you can change to vi, you should be able to save it).


Let me know if you are able to change your pager.. (I am not sure if 
pager they mean editor or something else in your environment, I use bash ).


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger in PErl

2008-04-14 Thread jeevs
On Apr 11, 6:08 pm, [EMAIL PROTECTED] (Jeevs) wrote:
 Thanks for the pointer Jenda And Chas..
 A little problem here... I was able to debug a sample script from
 command line...

 However when i used the   !#c:/perl5.10/bin/perl.exe -d:pktdb to debug
 cgi scripts through browser nothing happens and the script just does
 nothing except throwing the  problem loading page error.


And !#c:/perl5.10/bin/perl.exe -d:pktdb is #!c:/perl5.10/bin/perl.exe -
d:pktdb


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger in PErl

2008-04-12 Thread Daniel Kasak
On Thu, 2008-04-10 at 03:44 -0700, jeevs wrote:

 Is there a good debugger for perl. I have an application running on
 Ubuntu , with apache and mod perl along with mysql. and we are into
 reverse engineering the product. And need to debug the code. Is there
 any debugger for perl other than the internal debugger which we can
 use other than perl inbuild debugger.
 
 Thanks in advance

I use Eclipse with the EPIC plugin. It's a *little* tricky to get
working, but it's *way* ahead of the alternatives in terms of GUI and
features.

Dan

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger in PErl

2008-04-11 Thread jeevs
Thanks for the pointer Jenda And Chas..
A little problem here... I was able to debug a sample script from
command line...

However when i used the   !#c:/perl5.10/bin/perl.exe -d:pktdb to debug
cgi scripts through browser nothing happens and the script just does
nothing except throwing the  problem loading page error.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Debugger in PErl

2008-04-10 Thread jeevs
Is there a good debugger for perl. I have an application running on
Ubuntu , with apache and mod perl along with mysql. and we are into
reverse engineering the product. And need to debug the code. Is there
any debugger for perl other than the internal debugger which we can
use other than perl inbuild debugger.

Thanks in advance


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger in PErl

2008-04-10 Thread Chas. Owens
On Thu, Apr 10, 2008 at 6:44 AM, jeevs [EMAIL PROTECTED] wrote:
 Is there a good debugger for perl. I have an application running on
  Ubuntu , with apache and mod perl along with mysql. and we are into
  reverse engineering the product. And need to debug the code. Is there
  any debugger for perl other than the internal debugger which we can
  use other than perl inbuild debugger.
snip

ddd can debug perl and there is Perl's built-in debugger*.

* http://perldoc.perl.org/perldebug.html


-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger in PErl

2008-04-10 Thread Jenda Krynicky
From:   jeevs [EMAIL PROTECTED]
 Is there a good debugger for perl. I have an application running on
 Ubuntu , with apache and mod perl along with mysql. and we are into
 reverse engineering the product. And need to debug the code. Is there
 any debugger for perl other than the internal debugger which we can
 use other than perl inbuild debugger.

http://ptkdb.sourceforge.net/
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger question

2008-02-15 Thread Menghan Zheng

Menghan Zheng 写道:

type watch $i==10


w $i==10
这两天用gdb很多,我把gdb的语法和perl的语法搞混了, sorry

when $i is 10, the script pauses.
ANJAN PURKAYASTHA 写道:

I have a simple script that I'm using to learn debugging:
#! /usr/bin/perl -w

use strict;
use warnings;

my $i= 0;
while ($i= 15){
print ($i\n);
$i++;
}

Question: i would like to attach a breakpoint in the program at the 
step at

which $i takes on the value of 10. What command is used to do this?

All feedback will be appreciated.

TIA

Anjan










--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger question

2008-02-15 Thread Menghan Zheng

type watch $i==10
when $i is 10, the script pauses.
ANJAN PURKAYASTHA 写道:

I have a simple script that I'm using to learn debugging:
#! /usr/bin/perl -w

use strict;
use warnings;

my $i= 0;
while ($i= 15){
print ($i\n);
$i++;
}

Question: i would like to attach a breakpoint in the program at the step at
which $i takes on the value of 10. What command is used to do this?

All feedback will be appreciated.

TIA

Anjan







--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Debugger question

2008-02-15 Thread Stephen Kratzer
On Friday 15 February 2008 11:18:26 ANJAN PURKAYASTHA wrote:
 I have a simple script that I'm using to learn debugging:
 #! /usr/bin/perl -w

 use strict;
 use warnings;

 my $i= 0;
 while ($i= 15){
 print ($i\n);
 $i++;
 }

 Question: i would like to attach a breakpoint in the program at the step at
 which $i takes on the value of 10. What command is used to do this?

 All feedback will be appreciated.

 TIA

 Anjan

You want to set a watchpoint. This is a conditional breakpoint which is 
activated only when the associated condition is true. To add a watchpoint, 
type 'w expr' in the debugger where expr is the expression which must be true 
in order for the watchpoint to be activated. In your case, type 'w $i == 10'.

Stephen Kratzer
Network Engineer
CTI Networks, Inc.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: debugger questions

2008-02-02 Thread Peter Scott
On Fri, 01 Feb 2008 08:54:24 -0800, Tom Phoenix wrote:
 If you're trying to access a lexical variable, though, you'll need to stop
 the debugger somewhere within the scope of that lexical in order to access
 it by name. That's easy to do with a breakpoint.

ObPedantic: You can get at higher scoped lexicals with the 'y' command if
you have the PadWalker module installed:

% perl -d
{
  my $upper = 42;
  foo();
}

sub foo {
  print Stop here\n;
}
^D
main::(-:2):  my $upper = 42;
  DB1 c 7
main::foo(-:7):   print Stop here;
  DB2 x $upper
0  undef
 DB3 y 1 upper
$upper = 42
 DB4 h y
y [n [Vars]]   List lexicals in higher scope n.  Vars same as V.


That's why I added it :-)

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




debugger questions

2008-02-01 Thread Cort Morgan
Hi,

  Can anyone tell me is it possible to look at the current value of a variable 
in a package method, if the package was included in the main program with a use 
statement?

  I've read perldebug, perldebugtut, perldebguts, any web links I can find, and 
all no help (or I just don't understand them). Examples would be greatly 
appreciated.

I've tried 

V ABC::def varname

with no luck.

Thanks,

Cort


   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: debugger questions

2008-02-01 Thread Tom Phoenix
On Feb 1, 2008 8:04 AM, Cort Morgan [EMAIL PROTECTED] wrote:

   Can anyone tell me is it possible to look at the current value
 of a variable in a package method, if the package was included
 in the main program with a use statement?

Yes and kinda. If it's a package variable, yes; if it's a lexical
variable, you can see it from within its scope. But it doesn't depend
upon the 'use' statement. Here's a good explanation of the basics:

http://perl.plover.com/FAQs/Namespaces.html

If you know a variable's full name, including its package name, you
can access it from any line of code.

my $old_voltage = $Electro::Shock::electrode_volts;
my $new_voltage = ($old_voltage + 20) * 150; # evil laugh
$Electro::Shock::electrode_volts = $new_voltage;

If it's a lexical (my) variable, it doesn't have a package name. Its
name is valid only within its scope. But if you stop the debugger
within its scope, that qualifies.

 I've tried

 V ABC::def varname

That looks as if you're trying to examine $ABC::def::varname, or the
same name with a different sigil in front. That's a package variable,
not a lexical. Is that right? I would usually name the variable
directly in an x command; the debugger's x command shows you the
result of any expression.

This command examines the variable %optionVars in the DB package,
which is used by the debugger. The leading pipe character causes the
debugger to pipe the output to a pager program for easy reading; the
backslash preserves the structure of the hash:

  |x \%DB::optionVars

If you're trying to access a lexical variable, though, you'll need to
stop the debugger somewhere within the scope of that lexical in order
to access it by name. That's easy to do with a breakpoint.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




RE: question on redirecting output of Perl debugger commands

2006-07-12 Thread Gavin Bowlby
WC:

Thanks for your response!

I think what you suggested works fine for normal shell commands, but it
doesn't appear to work for the Perl debugger.

Here's a sample session, running on a Linux machine:

bash-2.05b$ cat test.pl
#!/usr/bin/perl

$x = 1;
print x:$x\n;

bash-2.05b$ perl -d test.pl | tee xxx 21  yyy

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(test.pl:3):  $x = 1;
  DB1 s
main::(test.pl:4):  print x:$x\n;
  DB1 p $x
1
  DB2 q
bash-2.05b$ ls -ralt
total 10116
...
-rw-rw-r--1 gbowlby  isp 0 Jul 12 11:21 yyy
-rw-rw-r--1 gbowlby  isp 0 Jul 12 11:21 xxx
drwxrwxr-x3 gbowlby  isp  4096 Jul 12 11:21 .
bash-2.05b$ cat xxx
bash-2.05b$ cat yyy
bash-2.05b$

So no output was sent to either the file xxx or yyy.

I would like to see the results of the Perl debugging session in a file.

Gavin

-Original Message-
From: Chasecreek Systemhouse [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 09, 2006 3:21 PM
To: beginners perl
Subject: Re: question on redirecting output of Perl debugger commands

On 7/7/06, Gavin Bowlby [EMAIL PROTECTED] wrote:
 Is there a way to redirect the output of a debugger command to a file?

What I use is Linux specific, sort of varies by bash and distro for
example, but you are welcome to try it out (I asked in irc #bash
before posting here) -

ls -ial |tee captured_output 21 | less

You will need to play with arrangement to get the desired effect.

-- 
WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: question on redirecting output of Perl debugger commands

2006-07-12 Thread Chasecreek Systemhouse

On 7/12/06, Gavin Bowlby [EMAIL PROTECTED] wrote:


bash-2.05b$ cat test.pl
#!/usr/bin/perl

$x = 1;
print x:$x\n;

bash-2.05b$ perl -d test.pl | tee xxx 21  yyy


Hmmm.

You know, when posted previously I guess I should have stated that I
had not yet gotten it to work myself but posted anyways kind of hoping
you might be able to.

Also I looked at the PerlDebug man page a few times while thinking
about this and I keep returning to this statement:

PerlDebugThe DB::OUT filehandle is opened to /dev/tty, regardless
of where STDOUT may be redirected to./PerlDebug

To me this implies it should be possible to capture it using something
like Expect (expect.nist.gov) -- but I simply have not had time to
delve that deeply into it.

Besides, and maybe I'm making a leap here, I have to think that it
isn't possible -- considering none of the Unix gurus have chimed in
about it.

Sorry.
--
WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: question on redirecting output of Perl debugger commands

2006-07-12 Thread Tom Phoenix

On 7/12/06, Gavin Bowlby [EMAIL PROTECTED] wrote:


I would like to see the results of the Perl debugging session in a file.


The debugger wasn't made with that in mind, but you could work around
it. At least, this works for me.

 open $DB::OUT, | tee dbug.txt or die if $DB::OUT;

You may find some escape sequences in the output. Some would call that
a feature.

If using that line early in your code (or as a debugger command) isn't
soon enough to catch what you need, you could wrap it in a BEGIN
block. If the BEGIN block doesn't make it execute soon enough, you can
hack a copy of perl5db.pl to start the tee as the debugger starts up;
see the perldebug manpage.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: question on redirecting output of Perl debugger commands

2006-07-12 Thread Gavin Bowlby
Tom, WC:

Thanks!

This works (almost) perfectly.

I issued the

open $DB::OUT, | tee dbug.txt 

as a Perl Debugger command. The output is a little funky when displaying
Perl debugger keyboard commands entered by the user, but the output
produced by the Perl debugger is captured faithfully in the output file.

It is really nice to have the brainpower of this reflector to answer
questions like this!

thanks again,
Gavin

sample keyboard session output follows:

bash-2.05b$ perl -d test.pl

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(test.pl:3):  $x = 1;
  DB1 open $DB::OUT, | tee dbug.txt

  DB2 s
main::(test.pl:4):  print x:$x\n;
  DB2 p $x
1
  DB3 q
bash-2.05b$ ls -ralt
...
total 8272
-rw-rw-r--1 gbowlby  isp   113 Jul 12 15:28 dbug.txt
bash-2.05b$ cat dbug.txt

  DB2 main::(test.pl:4):  print x:$x\n;
  DB2 1   = This is the output of the debugger p $x command.
bash-2.05b$

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Tom Phoenix
Sent: Wednesday, July 12, 2006 12:11 PM
To: Gavin Bowlby
Cc: perl beginners
Subject: Re: question on redirecting output of Perl debugger commands

On 7/12/06, Gavin Bowlby [EMAIL PROTECTED] wrote:

 I would like to see the results of the Perl debugging session in a
file.

The debugger wasn't made with that in mind, but you could work around
it. At least, this works for me.

  open $DB::OUT, | tee dbug.txt or die if $DB::OUT;

You may find some escape sequences in the output. Some would call that
a feature.

If using that line early in your code (or as a debugger command) isn't
soon enough to catch what you need, you could wrap it in a BEGIN
block. If the BEGIN block doesn't make it execute soon enough, you can
hack a copy of perl5db.pl to start the tee as the debugger starts up;
see the perldebug manpage.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: question on redirecting output of Perl debugger commands

2006-07-09 Thread Chasecreek Systemhouse

On 7/7/06, Gavin Bowlby [EMAIL PROTECTED] wrote:

Is there a way to redirect the output of a debugger command to a file?


What I use is Linux specific, sort of varies by bash and distro for
example, but you are welcome to try it out (I asked in irc #bash
before posting here) -

ls -ial |tee captured_output 21 | less

You will need to play with arrangement to get the desired effect.

--
WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




question on redirecting output of Perl debugger commands

2006-07-07 Thread Gavin Bowlby
Is there a way to redirect the output of a debugger command to a file?

I've tried the:

| debug_cmd

format, which nicely brings up the Pager to allow one page of output
at a time to be viewed, which works well with relatively small amounts
of data.

Unfortunately, my Perl app is large, has many variables, and I want to
view all of my variables to check for memory leaks after the app has run
for some time.

When I do this, using the X command, I get a few thousand pages worth
of screen displays.

I'm running under Cygwin, and the [EMAIL PROTECTED]! bash command window only
allows a maximum depth of 10K lines, which is much less than what I need
to view all of my variables.

The other complication is I need a combination of application keyboard
commands and Perl debugger commands to get to the point when I want to
issue the Perl debugger X command, so I don't think I can easily set
up a pipe to send combinations of Perl debugger commands and application
commands to a perl -d session.

Or maybe I'm wrong, and there's an easy way to do this...

Any suggestions will be welcomed...


Thanks,
Gavin Bowlby


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Different output when run from the debugger vs. the command line

2006-05-15 Thread Shimon Bollinger
When I run the following script from the command line, I get different
output than when I run it with the debugger.

#!/usr/bin/perl
use Config qw(myconfig);
print Config-myconfig;
1;

Here is the relevant differences in the output:

From the debugger:
 uname='linux lxcert-i386.cern.ch 2.4.21-27.0.2.el.cernsmp #1 smp thu
jan 20 01:37:09 cet 2005 i686 i686 i386 gnulinux '

From the command line:
 uname='linux lxc'

Why would this happen?

Perl and OS Info:
This is perl, v5.8.0 built for i386-linux-thread-multi (with 1
registered patch, see perl -V for more detail) 

Linux localhost.localdomain 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55
EDT 2005 i686 i686 i386 GNU/Linux

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




debugger and module code

2006-03-23 Thread tom arnall
is there any way to get the debugger to work on code in module files?

thanks,

tom arnall
north spit, ca



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




ignore question about debugger and modules

2006-03-23 Thread tom arnall
please ignore question about debugger and modules. i was using 'n' instead of 
's' to step through the code.

thanks,

tom arnall
north spit, ca



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Recommend debugger...

2006-01-20 Thread Bernard Kenik

Message-ID: [EMAIL PROTECTED]
Date: Thu, 19 Jan 2006 10:45:18 -0500
From: Chas Owens [EMAIL PROTECTED]
To: beginners@perl.org
Subject: Re: Recommend debugger...
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 1/19/06, SG Edwards [EMAIL PROTECTED] wrote:

Dear all,

I have started using the perl -d dubugger option to step through my
programs but it seems pretty crude and not too user friendly. Can
anyone reccommend a good freeware graphical debugger? I am writing
fairly simple text manipulation scripts.

Thanks,

Stephen Edwards


That depends on your environment.  I like ddd on machines that run an
X Server.  I don't have much experience debugging on windows, but I
know the Komodo editor from Activestate is pretty good (but
expensive).

I use Open Perl IDE   Pretty good ide and debugger 


www.sourceforge.net/projects/open-perl-ide

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Recommend debugger...

2006-01-19 Thread SG Edwards

Dear all,

I have started using the perl -d dubugger option to step through my 
programs but it seems pretty crude and not too user friendly. Can 
anyone reccommend a good freeware graphical debugger? I am writing 
fairly simple text manipulation scripts.


Thanks,

Stephen Edwards


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Recommend debugger...

2006-01-19 Thread Chas Owens
On 1/19/06, SG Edwards [EMAIL PROTECTED] wrote:
 Dear all,

 I have started using the perl -d dubugger option to step through my
 programs but it seems pretty crude and not too user friendly. Can
 anyone reccommend a good freeware graphical debugger? I am writing
 fairly simple text manipulation scripts.

 Thanks,

 Stephen Edwards

That depends on your environment.  I like ddd on machines that run an
X Server.  I don't have much experience debugging on windows, but I
know the Komodo editor from Activestate is pretty good (but
expensive).

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Recommend debugger...

2006-01-19 Thread RangerRickCA
 
Please remove me from this list!  Thank you!
 
RRCA



RE: Using the perl debugger with options

2005-02-23 Thread Tyson Sommer
 

 -Original Message-
 From: radhika [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 22, 2005 12:37 PM
 To: beginners@perl.org
 Subject: Using the perl debugger with options
 
 Hi,
 I am a beginner perl programmer (but not exactly a novice) 
 and am writing
 a perl module which is itself inherited from another module. 
 Also my perl
 script uses getopts for various command line options. How can 
 I use the
 perl debugger with cmd line options?
 
 every time I do:
 
 ./my_perl_script --install --dbname=blah
 
 does not work.
 
 Any hints will be helpful.
 
 regards,
 Radhika


Did you try:

perl -d /path/to/my_perl_script --install --dbname=blah

That works for me on my scripts with Getopt::Long



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Using the perl debugger with options

2005-02-23 Thread radhika
 Did you try:

   perl -d /path/to/my_perl_script --install --dbname=blah

 That works for me on my scripts with Getopt::Long



Hi,
I did try:
perl -d ./my_script --install --dbname=bbb
That did not seem to work for me. It could be that certain modules I am
writing are not loading properly. Another way to do this I found was
including perl -d in the perl script.

eg #! /usr/bin/perl -d -w

And this works.

Thanks anyways.
Radhika


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Using the perl debugger with options

2005-02-22 Thread radhika
Hi,
I am a beginner perl programmer (but not exactly a novice) and am writing
a perl module which is itself inherited from another module. Also my perl
script uses getopts for various command line options. How can I use the
perl debugger with cmd line options?

every time I do:

./my_perl_script --install --dbname=blah

does not work.

Any hints will be helpful.

regards,
Radhika


-- 
It's all a matter of perspective. You can choose your view by choosing
where to stand.
Larry Wall
---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Debugger question

2004-12-20 Thread Red King
Hi,

There is a script that uses a couple of modules and one of those
modules is setting an environmental variable. I need to determine
which of the used modules is doing that. Could someone let me know how
I should use the debugger to find this?

That is, script.pl does something like:

use ModuleA;
use ModuleB;
use ModuleC;
use ModuleD;

I need to determine whether it is ModuleA or ModuleB or ModuleC or
ModuleD which is setting an environmental variable FOO?

I looked at man perldebug but couldn't deduce anything useful.

Thanks in advance,
Amit

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Debugger question

2004-12-20 Thread Peter Scott
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Red King) writes:
There is a script that uses a couple of modules and one of those
modules is setting an environmental variable. I need to determine
which of the used modules is doing that. Could someone let me know how
I should use the debugger to find this?

That is, script.pl does something like:

use ModuleA;
use ModuleB;
use ModuleC;
use ModuleD;

I need to determine whether it is ModuleA or ModuleB or ModuleC or
ModuleD which is setting an environmental variable FOO?

Insert the line

BEGIN { $DB::single = 1 }

before those use statements and run under the debugger.

You should be able to set a watchpoint on $ENV{WHATEVER} to
make the search go faster.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Debugger question

2004-12-20 Thread Red King
Thanks Peter! That solved my problem.

Regards,
Amit


On 20 Dec 2004 16:36:27 -, Peter Scott [EMAIL PROTECTED] wrote:
 In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Red King) writes:
 There is a script that uses a couple of modules and one of those
 modules is setting an environmental variable. I need to determine
 which of the used modules is doing that. Could someone let me know how
 I should use the debugger to find this?
 
 That is, script.pl does something like:
 
 use ModuleA;
 use ModuleB;
 use ModuleC;
 use ModuleD;
 
 I need to determine whether it is ModuleA or ModuleB or ModuleC or
 ModuleD which is setting an environmental variable FOO?
 
 Insert the line
 
BEGIN { $DB::single = 1 }
 
 before those use statements and run under the debugger.
 
 You should be able to set a watchpoint on $ENV{WHATEVER} to
 make the search go faster.
 
 --
 Peter Scott
 http://www.perldebugged.com/
 *** NEW *** http://www.perlmedic.com/
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




FW: Trouble running Open Perl IDE Debugger

2004-06-22 Thread Siegfried Heintze


I'm working on Win2003.

I installed my perl from cygwin instead of directly installing it myself. It
seems to work fine for the cgi files executed by Apache HTTPD (hurray!).

However, when I use the OpenPerlIDE 1.0.11 the debugger dies on the
following line inside perl5db.pl:

my $result = Win32::GetFullPathName($filename);

My guess is that I need to define something in some environment variable.
What is the environment variable Perl uses to know where to look for pm
files?

Perhaps I just need to download Win32.pm? If that was true, then the pages
would not be working from Apache HTTPD, however.
   Siegfried


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: debugger

2003-12-22 Thread Jeff Westman
zentara [EMAIL PROTECTED] wrote:

 On 19 Dec 2003 09:16:10 -0700, [EMAIL PROTECTED] (Eric Walker) wrote:
 
 Hello all,
 When using the perl debugger, is there a way to load in the breakpoints
 and watch variables that I want from a file.  I am using it now and as I
 am debugging I am finding problems but when I start the program over I
 have to re-enter all my breakpoints and watch variables again. Can these
 be listed in a file and then read by the debugger to ease the amount of
 things to enter?
 
 I know you are asking about the perl debugger, but the Tk version
 ptkdb has menu item for saving settings for the script, which save
 all breakpoints and watched variables.

The GUI/Tk interface is superb  check it out.

If you don't have access to that (or can't install it like I can't [yes, even
in my own HOME directory]), you can always save your breakpoints and watches
to a plain text file, such as

b 84
b 192
W $line
W %custRec

then just use good ol' fashioned cut/paste once you enter the line mode of the
debugger

-Jeff


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: debugger

2003-12-20 Thread Peter Scott
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Eric Walker) writes:
Hello all,
When using the perl debugger, is there a way to load in the breakpoints
and watch variables that I want from a file.  I am using it now and as I
am debugging I am finding problems but when I start the program over I
have to re-enter all my breakpoints and watch variables again. Can these
be listed in a file and then read by the debugger to ease the amount of
things to enter?

This is why I added the 'source' command to the debugger in 5.8.  You
can put debugger commands for setting breakpoints or doing anything
else you like in a file and execute it whenever you like.  Just list
the breakpoints and watchpoints and turn them into the appropriate
commands (a simple script will automate that if you need).

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http//www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




debugger

2003-12-19 Thread Eric Walker
Hello all,
When using the perl debugger, is there a way to load in the breakpoints
and watch variables that I want from a file.  I am using it now and as I
am debugging I am finding problems but when I start the program over I
have to re-enter all my breakpoints and watch variables again. Can these
be listed in a file and then read by the debugger to ease the amount of
things to enter?

Thanks
Perlknucklehead





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Perl Debugger

2003-10-11 Thread Peter Scott
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Jeff Westman) writes:
Hi,

I'm using perl version 5.6.1 for Unix (HPUX-11).  I would like to be able to
retain my 'watches' and breakpoints in between debug sessions.  Is there a
way to do this with the standard debug library that comes with perl?

Sorry, no.  I agree it would be useful.  The 'R' command allows you to
restart debugging the same program with breakpoints (but not watchpoints)
preserved, but I assume you wish to be able to exit and come back to the
debugger later.

The 'R' command works by storing that information in environment variables.
You could hack it to save the information in a file as well, and look for
that file on startup.

-- 
Peter Scott
http://www.perldebugged.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Perl Debugger

2003-10-09 Thread Jeff Westman
Hi,

I'm using perl version 5.6.1 for Unix (HPUX-11).  I would like to be able to
retain my 'watches' and breakpoints in between debug sessions.  Is there a
way to do this with the standard debug library that comes with perl?

(I know I can save these with the ptkdb package, but I cannot get that to
work since it requires Tk which requires gcc which requires other libraries
... long story, but that's not an option)


TIA


-Jeff

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



debugger

2003-08-03 Thread awarsd
Hi,

my web host does not offer a perl debugger and told me to use

use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
Is that it, how should i print the errors??

Thank You.
awards



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: debugger

2003-08-03 Thread Todd W.

Awarsd [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 my web host does not offer a perl debugger and told me to use

 use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
 Is that it, how should i print the errors??


When you have a question about a module, please read the module's
documentation before posting here:

http://search.cpan.org/author/LDS/CGI.pm-2.99/CGI/Carp.pm

You are looking for the sections labeled:

MAKING PERL ERRORS APPEAR IN THE BROWSER WINDOW 

and

MAKING WARNINGS APPEAR AS HTML COMMENTS

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl Debugger IDE

2002-06-28 Thread Shawn

Hey Peter, thanks for the response,

  I had crawled back into my hacking hole, and just came up for air...

  I am not proficient at all with the perl debugger, that is why I was
looking for a gui version (not to mention the fact that Activestate's 
PDK took the command line debug over)...

I am not sure if this is the original error location, but this is
where it dies now.

dies on the second line here:
snippet
  ($self-{SELECT_ID})=$self-_fetch;
  for my $row (0..$#{@{$self-{SELECT_ID}}}) {
my %hash;
for(0..$#{@$list}) {
  $hash{$list-[$_]}=$self-{SELECT_ID}-[$row]-[$_];
}
push @{$self-{SELECT}}, \%hash;
  }

  sub _fetch {
my $self=shift;
my @rows;
while(my $row=$self-{STH}-fetchrow_arrayref) { push @rows, [@$row]; }
return(\@rows);
  }
/snippet

The debuggers produce the following error:

Please report this error to this site's webmaster.
Bizarre copy of ARRAY in leave at BB/DBM.pm line ...

I will forward this on to [EMAIL PROTECTED] as well I guess... 

I just assumed it was a problem with the debuggers, and I went on with 
peppering my scripts with print statements and reading those huge tail 
files...

Shawn

- Original Message - 
From: Peter Scott [EMAIL PROTECTED]
To: Shawn [EMAIL PROTECTED]; Beginners @ Perl.org [EMAIL PROTECTED]
Sent: Wednesday, June 26, 2002 4:05 PM
Subject: Re: Perl Debugger IDE


 At 02:09 AM 6/25/02 -0500, Shawn wrote:
 Does anyone know of a IDE debugger that does not choke on complex data 
 objects?  I have tried all of the following, but they all have a 
 serious problem with dereferencing an array of referenced hashes...
 
 VisiPerl
 Open Perl IDE
 OptiPerl
 ActiveState's PDK
 
 I am getting the Bizarre copy of ARRAY in leave at ... when run 
 through any of these debuggers, and yet the script runs fine from the 
 command line (and the browser).  I would really like to see what the 
 internal vars are doing without having to run through  a tail file 
 that gets quite large quite fast with all the 'steps'.  It is also 
 annoying to have to pepper the scripts with debug objects...
 
 (1) Do you get the same problem with Perl's command-line 
 debugger?  Something similar or identical to this was reported recently 
 to the Perl 5 Porters.  I don't recall if it's been fixed yet.
 
 (2) If so, can we see some code, provided you can get it below a dozen 
 lines or so?  My guess is that this is a bug in the part of Perl 
 underlying all those debuggers and if it hasn't been reported yet then 
 we should do so.
 
 
 --
 Peter Scott
 Pacific Systems Design Technologies
 http://www.perldebugged.com/
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Debugging the debugger

2002-06-26 Thread Harry Putnam

Paul Johnson [EMAIL PROTECTED] writes:

 The text is still there in the latest release candidate for Perl 5.8.0.
 If anyone feels like saving the world, now would be a very good time to
 do it.  In other words, documentation patches are still being accepted.

That would first require one to understand what it means and how it
works, which cuts me out of the loop for sure.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl Debugger IDE

2002-06-26 Thread Peter Scott

At 02:09 AM 6/25/02 -0500, Shawn wrote:
Does anyone know of a IDE debugger that does not choke on complex data 
objects?  I have tried all of the following, but they all have a 
serious problem with dereferencing an array of referenced hashes...

VisiPerl
Open Perl IDE
OptiPerl
ActiveState's PDK

I am getting the Bizarre copy of ARRAY in leave at ... when run 
through any of these debuggers, and yet the script runs fine from the 
command line (and the browser).  I would really like to see what the 
internal vars are doing without having to run through  a tail file 
that gets quite large quite fast with all the 'steps'.  It is also 
annoying to have to pepper the scripts with debug objects...

(1) Do you get the same problem with Perl's command-line 
debugger?  Something similar or identical to this was reported recently 
to the Perl 5 Porters.  I don't recall if it's been fixed yet.

(2) If so, can we see some code, provided you can get it below a dozen 
lines or so?  My guess is that this is a bug in the part of Perl 
underlying all those debuggers and if it hasn't been reported yet then 
we should do so.


--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Debugging the debugger

2002-06-25 Thread Paul Johnson

On Mon, Jun 24, 2002 at 10:10:38PM -0700, Harry Putnam wrote:

 The documentation in TERM::Readline at ENVIRONMENT reads like maybe
 some kind of cut and paste editing went wrong or something.  It reads
 like gibberish.  The usage of the words `head' `tail' and `ornaments'
 is confusing to the point of being seemingly meaningless. 
 
 I suspect there was some sort of undetected editorial mishap
 there. or maybe a language translation problem.

Possibly both.  I'm not certain, but the wording may have come from a
rather brilliant Russian mathematician and Regular Expression expert.

The text is still there in the latest release candidate for Perl 5.8.0.
If anyone feels like saving the world, now would be a very good time to
do it.  In other words, documentation patches are still being accepted.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Debugging the debugger

2002-06-24 Thread Bob Showalter

 -Original Message-
 From: Harry Putnam [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, June 23, 2002 3:13 AM
 To: [EMAIL PROTECTED]
 Subject: Debugging the debugger
 
 
 Just going thru the debug tutorial:
perldoc perldebtut
 Following along having writen the example script to disk.
 I notice any `p' commands gives me a line with the first character
 chopped off.
 
 Like when the tutorial gets to the part where you `p $key', I get
 elcome  instead of Welcome.  Actually it seems to print the line into
 my xterm like:
 
   DB2 p $key w
   elcome
 
 Notice the `w' way to the right there.  This appears to possibly be
 TERM related.  $echo $TERM shows xterm.   My setup is:
 OS = Redhat 7.3
 Xwin setup Gnome/sawfish
 
 Running debugger in an xterm  (not gnome-terminal)
 
 Anyone have an idea what might be causing this?
 Can it be readline?

I have this problem using Putty and FreeBSD. I was able to fix it by
adding the following to my .bashrc:

   export PERL_RL= o=0

This was documented in perldoc Term::ReadLine. Not sure exactly why
it works...

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Debugging the debugger

2002-06-23 Thread Harry Putnam

Just going thru the debug tutorial:
   perldoc perldebtut
Following along having writen the example script to disk.
I notice any `p' commands gives me a line with the first character
chopped off.

Like when the tutorial gets to the part where you `p $key', I get
elcome  instead of Welcome.  Actually it seems to print the line into
my xterm like:

  DB2 p $key w
  elcome

Notice the `w' way to the right there.  This appears to possibly be
TERM related.  $echo $TERM shows xterm.   My setup is:
OS = Redhat 7.3
Xwin setup Gnome/sawfish

Running debugger in an xterm  (not gnome-terminal)

Anyone have an idea what might be causing this?
Can it be readline?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Debugging the debugger

2002-06-23 Thread Peter Scott

At 12:13 AM 6/23/02 -0700, Harry Putnam wrote:
Just going thru the debug tutorial:
perldoc perldebtut
Following along having writen the example script to disk.
I notice any `p' commands gives me a line with the first character
chopped off.

Like when the tutorial gets to the part where you `p $key', I get
elcome  instead of Welcome.  Actually it seems to print the line into
my xterm like:

   DB2 p $key w
   elcome

Notice the `w' way to the right there.  This appears to possibly be
TERM related.  $echo $TERM shows xterm.   My setup is:
OS = Redhat 7.3
Xwin setup Gnome/sawfish

Running debugger in an xterm  (not gnome-terminal)

Anyone have an idea what might be causing this?
Can it be readline?

That's my guess.  The p command in the debugger is equivalent to

 print $DB::OUT

so there's nothing mystical there.  Try typing

 print Hello\n

at a debugger prompt.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Debugging the debugger

2002-06-23 Thread Harry Putnam

Peter Scott [EMAIL PROTECTED] writes:

  print Hello\n

 at a debugger prompt.

Yeah, it gives the same chopping action:
main::(./temp:2):   e strict;
  DB1  print Hello\n  H
ello

  DB2 
Any ideas how to correct this?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




ActiveState Debugger

2002-04-04 Thread Babichev Dmitry

Hello, beginners.

Sorry to trouble you.

How i can forbid output of the report on absence licence in the subject?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




PERL Debugger trace question...

2002-01-17 Thread Richard.C.1


I'm new to using the debugger and have printed and read the debugger
description and commands. It mentions that you can create a
command/parameter file that contains commands but doesn't say how or where
it must be located. I would like to have some way of doing an autotrace on a
PL program as it executes. I need to see how it progresses through lines and
subroutines, so if I can have a trace of it's execution written out to a
file that would be ideal! I'm on an NT 4 system. Thanks!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl debugger window

2002-01-17 Thread Gary Hawkins

I mentioned the perl debugger before but I guess some people would not have had
the GUI version available.  It comes with the Perl Development Kit, so I should
clarify.

Don't know about *n*x but if you installed ActivePerl on Windows, then install
the Perl Development Kit and try:

 perl -d myscript.pl

That opens a window with myscript.pl in a debug session.

Beats print $thisvar; `pause`;
Great in a loop for tough problems.
Educational.
Highlight a var and copy to watch.
Add $var[x] for @var, etc.
Step through script.
Try the 'run to cursor' button.
Set a breakpoint by clicking the margin at that line.

Perl Development Kit:
http://www.activestate.com/Products/Perl_Dev_Kit/

Have fun,

Gary



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl debugger window

2002-01-17 Thread Jenda Krynicky

From:   Gary Hawkins [EMAIL PROTECTED]

 I mentioned the perl debugger before but I guess some people would not have had
 the GUI version available.  It comes with the Perl Development Kit, so I should
 clarify.
 
 Don't know about *n*x but if you installed ActivePerl on Windows, then install
 the Perl Development Kit and try:
 
  perl -d myscript.pl
 
 That opens a window with myscript.pl in a debug session.

There is also a free Perl only debuger based on Tk :
http://world.std.com/~aep/ptkdb/

Works on *nixes as well as Windoze :-)

Jenda


=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl debugger

2001-12-22 Thread fliptop

Polikarpov Cyrill wrote:

 I have a question  -  what software is the better for debugin perl-scripts to your 
opinion?
 I can't find a prog for myself, so ...


perl comes with a built-in debugger:

http://www.ddj.com/documents/s=1498/ddj0108pl/

btw:  a search for 'perl debugger' on google.com turned up about 91,000 
hits.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl debugger

2001-12-22 Thread zentara

On Sat, 22 Dec 2001 09:24:38 +0200, [EMAIL PROTECTED] (Polikarpov Cyrill)
wrote:

Hi everybody!

I have a question  -  what software is the better for debugin perl-scripts to your 
opinion?
I can't find a prog for myself, so ...

Use the ptkdb module. It uses a graphical tk interface, so it's easy to
understand. Go to cpan.org, do a search for ptkdb, install it and
look at the examples. It even has a way of doing it with cgi.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl debugger

2001-12-21 Thread Polikarpov Cyrill

Hi everybody!

I have a question  -  what software is the better for debugin perl-scripts to your 
opinion?
I can't find a prog for myself, so ...

--
Sinsirely,
Cyrill S. Polikarpov
[EMAIL PROTECTED]



RE: perl debugger

2001-08-03 Thread Crowder, Rod

-Original Message-
From: Ruth Albocher [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2001 10:56
To: [EMAIL PROTECTED]
Subject: perl debugger


hi all.
Is there any good stable graphic debugger for perl?
thanks



Try the one in the ActiveState Perl Dev Kit. 
You can download and try it for free before you buy

http://www.activestate.com/Products/Productivity/Perl_Dev_Kit/index.html

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]