top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Debugging and passing constant value at run time in perl?

0 votes

I am using constant mainly to enable printing of debugging messages (e.g. use constant DEBUGGING_L1 => 0;)

Normally, the value is '0' and when I need to see debug messages, I make this 1 and run the script. Is there a way to allocate value to constants at run time so that I can avoid editing the script again and again?

Also, is there a better way to handle debugging?

posted Jul 7, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
answer Jul 7, 2015 by Abhay
Similar Questions
+1 vote

I am running a script under perl -d and want to break execution at line 243 in this case. perl -d scriptname loads the script in to the debugger and b 243 sets the break point. c then Enter starts the program which runs until it reaches the desired line at which point it stops. All I want to do is get it to loop multiple times through this point and then stop.

This is similar to the behavior of gdb where you could tell it to stop after, say, 250 passes through the break point.

+1 vote

I have a Linux machine and windows machine, I need to run a GUI of Linux machine on the windows machine.
I don't want to use putty or any other software. I have to use any Perl modules to achieve this please help.

0 votes

We are running debian linux stable (Jessie) with apache 2.4.10 and mod_wsgi 4.3.0-1 on a x86_64 machine. Our application is written in python 2.7 and django 1.8.

The list of modules as reported by apachectl -M are:Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_worker_module (shared) negotiation_module (shared) perl_module (shared) rewrite_module (shared) setenvif_module (shared) socache_shmcb_module (shared) status_module (shared) wsgi_module (shared)

We were getting segmentation faults when rest api clients were making requests. The apache error log has the following messages:

[Mon Jul 27 09:04:38.375433 2015] [core:notice] [pid 32693:tid 140315326191488] AH00052: child pid 32700 exit signal Segmentation fault (11)
[Mon Jul 27 09:04:38.375556 2015] [core:notice] [pid 32693:tid 140315326191488] AH00052: child pid 32701 exit signal Segmentation fault (11)

I have enabled core dumps by setting ulimit to unlimited and adding core dump config directive in the apache2.conf file.
but the core dumps are not happening. When I tried to debug using gdb (gdb /usr/sbin/apache2), the environment variables are not getting read. Any clues on how to go about this?