I'm trying to basically do a search through the database with Perl to tell if there is an item with a certain ID,. This search can return no rows, but it can also return one.
I have the following code:
my $th = $dbh->prepare(qq{SELECT bi_exim_id FROM bounce_info WHERE bi_exim_id = '$exid'});
$th->execute();
if ($th->fetch()->[0] != $ex...
My question is the antithesis of How do I process input immediately instead of waiting for newline. I want to continue reading a growing log file, but stop after the file has not grown for a specified number of seconds.
I found Sys::AlarmCall at CPAN, and tried as shown below, but it doesn't time-out when I run:
perl progress.tracker....
I appreciate the ability to be able to do: http://server/controller/runmode or even http://server/controller/runmode/id. But if I have a lot of optional parameters I'd like to be able to do the regular: http://server/controller/runmode?foo=bar&baz=frew, especially since I have a lot of JS that will do the latter for me. Does anyone...
I am using CGI::Application on mod_perl with DBIx::Class and I'd like to have something like new define a new dbic schema on instantiation. So far I haven't been able to get it to work. The closest thing I have come to is a superclass that has a connect() method that returns a new object, but I would rather it be already be connected...
I am developing an application with mod_perl and restarting the server every time I change code is a huge drag. I'd like to still use mod_perl for development because it's what I plan on using for the live server. I didn't see anything in the documentation about how to do this.
Thoughts?
...
I need some help getting a regex working to parse all referrers from an apache access log file which come from real links offsite and which are valid referrals from real people rather than bots or spiders. I'm working in Perl.
This bit of code almost works already [the access log is opened with the filehandle $fh]:
my $totalreferals = ...
I want to upload a list of users from my work's LDAP server to upload into our wiki as a company directory.
How can I download a list of users from an LDAP server using Perl?
Thanks.
...
Hi,
I have a Perl program, that needs to use packages (that I also write). Some of those packages are only chosen in Runtime (based on some environment variable). I don't want to put in my code a "use" line for all of those packages, of course, but only one "use" line, based on this variable, something like:
use $ENV{a};
Unfortunatel...
I'm working on a very large CGI application that uses Crypt::RSA, which is properly installed. I get a "attempted to call a null reference as a function" type of error (I can't go back to get the exact error right now because we had to rollback for a release date) when I try to run any the embedded library. I trace the null reference t...
In Unix, I need to be able to archive log files into monthly folders, labelled accordingly. How do I do this in Perl?
...
How can one pass command line arguments via file association in Vista 64?
I recently built a PC running Vista Ultimate 64-bit. I noticed several of the Perl scripts I transferred failed due to command-line arguments not being passed. As a simple test, I wrote the following (foo.pl):
#!/usr/bin/perl -w
use strict;
my $num_args = $#ARG...
What are the most common reasons that I would be getting this error from running a Perl script:
Memory fault(coredump)
I am running two SQL commands beforehand that only store ~1500 rows each with 6 fields. The SQL works fine out of the script, so I don't think I'm getting the error from that. And half of my code runs before it takes ...
I'm trying to get some code called after each request completes using Catalyst. Basically, I want to run some code as part of finalize. Supposedly Catalyst::Plugin::Observe will do this, but it appears completely broken (just loading the plugin breaks Catalyst).
I'm trying to fix the Observe plugin, but that's proving stubborn.
So, is ...
Hi,
I need to clear the read-only flag of a file in my Perl program that runs on Windows.
I know system("attrib -r $filename") would work, but I was wondering if there is no built-in option in Perl to do it. chmod 777, $filename doesn't seem to work.
Thanks,
splintor
...
I want to write a piece of software which is essentially a regex data scrubber. I am going to take a contact list in CSV and remove all non-word characters and such from the person's name.
This project has Perl written all over it but my client base is largely non-technical and installing Perl on Windows would not be worth it for them.
...
Given a DBIx::Class resultset, for example:
my $rs = $c->model("DB::Card")->search({family_name => "Smith"});
the tutorials I've read use the stash to pass an arrayref of rows:
$c->stash->{cards} = [$rs->all];
This results in the query getting executed at this point, and the resulting objects stuffed into the stash, so they can be ...
I've got a bunch of first names in a field that carry a middle initial with a '.' at the end..I need a regex to convert this example:Kenneth R.intoKennethI was trying to build my own and found this useful site btw..http://www.gskinner.com/RegExr/but I'm new to Perl & regular expressions and could only get "...$" - which is useless when t...
According to Test::More documentation, it will exit with certain exit codes depending on the out come of your tests.
My question is, how do I check these exit codes?
ps. I am trying to build a harness myself. Is there a simple harness I can use?
ps2. Test::Harness did the trick for me. In particular execute_tests function. This functio...
I have an XML file with the following line:
<VALUE DECIMAL_VALUE="0.2725" UNIT_TYPE="percent"/>
I would like to increment this value by .04 and keep the format of the XML in place. I know this is possible with a Perl or awk script, but I am having difficulty with the expressions to isolate the number.
...
I'm having a little trouble getting my head around the conceptual difference between an object and a class. I don't really understand the distinction between the two in any programming language, but currently I'm working with Perl, and Moose, so I'd prefer an explanation using those things.
Cheers
...