I'm trying to make a Jabber bot and I am having trouble keeping it running while waiting for messages. How do I get my script to continuously run? I have tried calling a subroutine that has a while loop that I, in theory, have set up to check for any messages and react accordingly but my script isn't behaving that way.
Here is my sour...
I need to create a PDF file from the HTML I have created usign rrdcgi. This page contains the details and graphs in PNG format. I have written the below code using Perl module HTML::HTMLDoc to create a PDF file using saved HTML file. The images are of size width 1048 and hight 266 but when creating a PDF file the images are not shown com...
I have a few log files like these:
/var/log/pureftpd.log
/var/log/pureftpd.log-20100328
/var/log/pureftpd.log-20100322
Is it possible to load all of them into a single filehandle or will I need to load each of them separately?
...
I have created a file argument.pl which takes several arguments first of which should be in form of a year For example: 2010 23 type. Here 2010 is a year
my code does something like:
use strict;
use warning
use Date::Calc qw(:all);
my ($startyear, $startmonth, $startday) = Today();
my $weekofyear = (Week_of_Year ($startyear,$startmonth...
Edited - Ummm - now have a module in schwigon giving same problem !!
I am on a corporate PC that forces mcshield on everything that moves.
I get blocked when trying to mirror on
...
authors/id/J/JV/JV/EekBoek-2.00.01.tar.gz ... updated
authors/id/J/JV/JV/CHECKSUMS ... updated
Could not stat tmpfile '/cygdrive/t/cpan_mirror/authors/id/J...
What is equivalent to perl expression: /ing$|ed$|en$/ in boost regular expression?
Words end with ing or ed or en should match with reg expression in boost!
...
I'm about to embark on a project that will need to:
Process XML
Heavy text parsing of non-xml documents
Insertion of data from xml and non-xml documents into a relational DB.
Present processed data to user from db using webpages.
Must handle load very well.
The website will be subject to short periods of very heavy loads to pages (30...
I have a CGI program I have written using Perl. One of its functions is to upload pics to the server.
All of it is working well, including adding all kinds of info to a MySQL db. My question is: How can I get the uploaded pic files location and names added to the db?
I would rather that instead of changing the script to actually uploa...
I am trying to catch the string cd /a/b/c and do the following conversion
(as part of a larger Perl program).
If cd /a/b/c exists then convert cd /a/b/c chdir '/a/b/c' and execute chdir '/a/b/c'
I can do the conversion; I can't tell perl to execute my command.
...
I need to get the remote user name in my CGI script. Where do I find that? I want to display that name on the page that I return.
...
When I run this:
use feature ':5.10';
$x=1;
given ($x) {
when(1) {
say '1';
$x = 2;
continue;
}
when (2) {
say '2';
}
}
This should print both 1 and 2, but it only prints 1. Am I missing something?
EDIT:
I have added $x = 2 and it still prints only "1"
...
In perl, the FindBin module is used to locate directory of original script. What's the best way to get this directory in python?
...
As the title says, I'm not clear on when such a subroutine will be called. From the require page at perldoc one can write:
push @INC, \&my_sub;
sub my_sub {
my ($coderef, $filename) = @_; # $coderef is \&my_sub
...
}
but where does this go exactly? The required package or the requiring script (or package)? I've tried both wit...
I am trying to process data with a set of threads and enqueue it with another, currently the enqueueing and dequeueing process doesn't seem to be working
Any thoughs??
sub process() {
while (my @DataElement = $DataQueue->dequeue()) {
print "\t".$DataElement[0]."\n";
}
}
I use the following to enqueue the data
my @l;...
I am calling a command-line program from my Perl script. When these programs crash, I am prompted with a messagebox asking me if I want to notify Microsoft. Since this is an automated system it would be desirable if I could suppress that message and continue with other things in my script. Is this possible?
...
We have a very long form that has a number of fields and 2 different submit buttons. When a user clicks the 1st submit button ("Photo Search") the form should POST and our script will do a search for matching photos based on what the user entered in the text input ("photo_search_text") next to the 1st submit button and reload the entire ...
I have been helping someone debug some code where the error message was "Day too big". I know that this springs from localtime and the Y2038 bug (most google results appear to be people dealing with cookies expiring well into the future).
We appear to have 'fixed' the problem by using time to get the current date. However, given that ...
I want to test a script I have written in Perl and specifically check what output it writes to file. I wrote it some time ago and don't want to modify it to the extent of turning it into a module but would like to regression test it before adding some small functional changes.
So far I have
use Test::Command tests => 10;
exit_is_num($...
I'm written small code to connect to remote server using Perl but observing error messages
#!/usr/bin/perl -w
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>60, Errmode=>'die');
$telnet->open('192.168.50.40');
$telnet->waitfor('/login:/');
$telnet->print('queen');
$telnet->waitfor('/password:/');
$telnet->print('kinG!');
...
Is the performance hit with using MooseX::Declare mainly encountered while it does its initial magic (i.e. "translating" the definition into standard Perl syntax)? i.e. once the compile and initial runtime setup is complete, is there a performance difference in calling a MooseX::Declare method vs a method defined via traditional declarat...