Hi
I've wrapped Perl's Net::SSH::Expect with a small module to reduce the boilerplate code needed to write a new configuration script for use with our HP iLO cards. While on one hand I want this wrapper to be as lean as possible, so non-programmer colleagues can use it, I also want it to be as well-written as possible.
It's used like s...
I need to extract all the images from a PDF file on my server. I don't want the PDF pages, only the images at their original size and resolution.
How could I do this with Perl, PHP or any other UNIX based app (which I would invoke with the exec function from PHP)?
...
I'm working on designing a multi-tiered app in Perl and I'm wondering about the pros and cons of the various IPC mechnisms available to me. I'm looking at handling moderately-sized data, typically a few dozen kilobytes but up to a couple of megabytes, and the load is pretty light, at most a couple of hundred requests per minute.
My pri...
I found myself struggling with me every time I am asked, which language to prefer for a web-application. Most people dismiss the importance of a good architecture. That why a answer that architecture is more important than the language. Afterwards sometimes I sompare the advantadges.
But that is always not about the language but im most ...
I want to be able to pass something into an SQL query to determine if I want to select only the ones where a certain column is null. If I was just building a query string instead of using bound variables, I'd do something like
if ($search_undeleted_only)
{
$sqlString .= " AND deleted_on IS NULL";
}
but I want to use bound que...
I'm working on a test framework in Perl. As part of the tests, I may need to add precondition or postcondition checks for any given test, but not necessarily for all of them. What I've got so far is something like:
eval "&verify_precondition_TEST$n";
print $@ if $@;
Unfortunately, this outputs "Undefined subroutine &verify_preconditio...
Recently there have been a few attackers trying malicious things on my server so I've decided to somewhat "track" them even though I know they won't get very far.
Now, I have an entire directory containing the server logs and I need a way to search through every file in the directory, and return a filename if a string is found. So I tho...
I am trying to get a list of subdirectories in a given directory using something like the following:
#!/usr/bin/perl -wT
use strict;
use warnings;
use File::Find::Rule;
use Data::Dumper;
my @subdirs = File::Find::Rule->maxdepth(1)->directory->relative->in('mydir');
print Dumper(@subdirs);
However, running this gives the result:
...
Hi,
I am writing a JSON response from a perl/cgi program. The header's content type needs to be "application/json". But it doesn't seems to be recognized as response is thrown as a text file.
I would be capturing response using JSON library of jQuery. Where am I missing in sending the JSON response.
...
What do you recommend for setting the MAMP development stack? I've seen the quickstart thing at http://www.mamp.info, but I don't really like that approach. I'd rather have a full-fledged Apache that I can install any number of modules into. I remember seeing in the Leopard Server demo a really slick GUI that allows you to setup all this...
What is the best way to get Adobe Flex/AIR to communicate with perl Catalyst?
We are currently using Catalyst::Plugin::XMLRPC on the Catalyst side and as3-rpclib on the Flex/AIR side. That works fine, but I'd rather take as3-rpclib out of the picture and use a method that is native to Flex.
From what I can tell, it's native compnone...
Is there a test suite for PDFs, preferably in Perl? What I want is some function to test positioning and existence of some text (and if possible a name of a grapic) in a PDF file. Is this theoritically possible with PDF markup?
Thank you for your help.
...
When I read a directory in Perl with opendir, readdir, and closedir, the readdir function doesn't seem to read the files in any specific order (that I can tell).
I am reading a directory that has subdirectories named by epoch timestamp:
1224161460
1228324260
1229698140
I want to read in these directories in numerical order, which wou...
I have a Web-based Perl Win32::OLE script that uses Excel on the server side. It has been working happily for years on a Win2000 server running Excel2000. We recently upgraded to Win2003/Excel2003 and I now get the following error from the script:
Win32::OLE(0.1709) error 0x80070005: "Access is denied" at create_worksheet_lib.plx line ...
I'd like to create several modules that will be used in nearly all scripts and modules in my project. These could be used in each of my scripts like so:
#!/usr/bin/perl
use Foo::Bar;
use Foo::Baz;
use Foo::Qux;
use Foo::Quux;
# Potentially many more.
Is it possible to move all these use statements to a new module Foo::Corge and the...
I have a file format which is similar to "IDY03101.200901110500.axf". I have about 25 similar files residing in an ftp repository and want to download all those similar files only for the current date. I have used the following code, which is not working and believe the regular expression is incorrect.
my @ymb_date = "IDY.*\.$year$mon$...
In lib\RT\CustomFieldValues\ there is the groups.pm file which is supposed to be an example of how to get data into a custom field, but how do I actually use that once I have written it? Does anyone have any documentation or a sample of this?
...
I'm investigating using DbC in our Perl projects, and I'm trying to find the best way to verify contracts in the source (e.g. checking pre/post conditions, invariants, etc.)
Class::Contract was written by Damian Conway and is now maintained by C. Garret Goebel, but it looks like it hasn't been touched in over 8 years.
It looks like wha...
I'm pushing elements into an array during a while statement. Each element is a teacher's name. There ends up being duplicate teacher names in the array when the loop finishes. Sometimes they are not right next to each other in the array, sometimes they are.
How can I print only the unique values in that array after its finished getting...
I have some questions about Perl's "map" function.
Specifically:
How does
%hash = map {$_ => 1} @array
create a hash mapping array's elements to 1? How does block return a list of two elements? I thought block returns its last value. Does => implicitly create a list, as opposed to "," that returns its right argument?
Why does
%hash...