you have a question on how to do something in Perl, or
you need a Perl solution to an actual real-life problem, or
you're unsure why something you've tried just isn't working...
then this section is the place to ask. Post a new question!
However, you might consider asking in the chatterbox first (if you're a
registered user). The response time tends to be quicker, and if it turns
out that the problem/solutions are too much for the cb to handle, the
kind monks will be sure to direct you here.
I'm trying to write a perl script that will log into a particular site. There is a bug on the site that issues a bogus error (browser does not accept cookies), and username & passwords are cleared. But if I manually re-enter the username and password, my logi is successful.
I'm trying to emulate this behavior in perl by testing for the cookies error after my initial login attempt, I repeat the following:
I have a working application with ActivePerl 5.18 (Windows7)...I have received advice to replace ActivePerl with Strawberry Perl but I am loath to take the chance of screwing up the work I have done.
What are the drawbacks/perils of doing this.
I found Log::Rolling, the CPAN page said it was at version 1.02, but when I installed it via cpanm, it said I installed v1.00.
I have a Perl program that runs continuously and checks email every 30 minutes. At the beginning of a program it opens a log file, and writes entries as the program is run, so I can capture any errors before the program is stopped or crashes. The program can only be stopped by Control-C at the terminal it is running on. Or via an email command sent to it.
I want to limit the size of this log file to about 1000 lines. I don't need anything complex. Simple will do.
After downloading the 1.02 tar.gz file, and installing it, it seems only the internal documentation of the module is wrong. As the .tar.gz file also reported it was installing v1.00.
I have a custom nagios plugin which is written in Perl. For complicated political reasons I am required to hide the source code of this plugin. The only way I found to do this was by using perlc (http://marginalhacks.com/Hacks/perlc).
In the words of author:
"Takes a single perl script, converts the block using a simple encoding with an optionally defined key. The script is decoded at runtime and fed to the perl library, to avoid it getting in the hands of the user."
The problem I am getting is that Nagios shows "No output returned from plugin" when I used the compiled version of the plugin. The raw perl source works just fine, as does running the compiled version on the command line.
After debugging for a while I narrowed the problem down to using exit in perl. I.e
This works fine when compiled.
This zip file is about 12 GB and I know that this module has the limitation of zipping no more than 4 GB, but I am trying to see if it can at least be used to access the members of a a +4GB archive.
here is the error I am getting:
at /usr/share/perl5/Archive/Zip.pm line 477.
'/home/mohamad/Desktop/VM/vm.zip') called at
/usr/share/perl5/Archive/Zip/Archive.pm line 603
'IO::File=GLOB(0xb75ae8)', '/home/mohamad/Desktop/VM/vm.zip') called
at /usr/share/perl5/Archive/Zip/Archive.pm line 548
'/home/mohamad/Desktop/VM/vm.zip') called at test.pm line 6 read error
+ at test.pm line 7.
I have written a Perl script which copies deliverable on machine A (and also takes a backup of the same on another machine B) and then invokes a shell script which is already present on machine A. This shell script deploys the deliverable (generally a war file) on machine A. Though this whole task of copying and invoking the shell script could have been written in bash quiet easily, I thought of using Perl just because I had not written Perl program for quite some time. We have a master-slave setup of Jenkins and the Perl script runs from Jenkins slave.
Also, there is sufficient memory on the box where the deliverable is copied and finally deployed. Disk space is also not an issue on either of the machines. Both are Linux instances running on AWS.
Now the issue is that though the program runs fine, many a times, it stucks when the deployment script (shell script) is called. To debug, i ran the Perl script in Jenkins using Devel::Trace. When the build got stuck, I aborted the build. As soon as I aborted the build, I got heap space error so I added Xms & Xmx parameters to set initial and maximum Java heap size respectively. After confirming that the settings are applied, I ran the builds again. Few builds passed and few again got stuck. I don’t think increasing heap size further makes any sense. A shell script was written to do the same task and it does not require any such extra memory to run. Now I am not sure where to look for clues.