perl

How do I use a vendor Apache with a self-compiled Perl and mod_perl?

I want to use Apple's or RedHat's built-in Apache but I want to use Perl 5.10 and mod_perl. What's the least intrusive way to accomplish this? I want the advantage of free security patching for the vendor's Apache, dav, php, etc., but I care a lot about which version of Perl I use and what's in my @INC path. I don't mind compiling my ...

Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?

Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl? ...

Perl Regex Match and Removal

I have a string which starts with //#... goes upto the newline characater. I have figured out the regex for the which is this ..#([^\n]*). My question is how do you remove this line from a file if the following condition matches ...

Best practises for holding passwords in shell / Perl scripts?

I've recently had to dust off my Perl and shell script skills to help out some colleagues. The colleagues in question have been tasked with providing some reports from an internal application with a large Oracle database backend, and they simply don't have the skills to do this. While some might questions whether I have those skills eith...

What are the perldoc perlxxx options?

It appears that using perldoc perl gives the list of, e.g. perlre, perlvar, etc. Is this the best place to find the list of what's available as an overview or tutorial or reference manual section? Is there another, better list? ...

Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?

I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for a dynamic language? What helper tasks can be done by the dynamic languages faster or better after only a few days of learning than with th...

How can I use perldoc to lookup the %ENV variable?

I find from reading perldoc perlvar, about a thousand lines in is help for %ENV. Is there a way to find that from the command line directly? On my Windows machine, I've tried the following perldoc ENV perldoc %ENV perldoc %%ENV perldoc -r ENV (returns info about Use Env) perldoc -r %ENV perldoc -r %%%ENV perldoc -r %%%%ENV (says No doc...

How do I get the full path to a Perl script that is executing?

I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath+filename and sometimes just filename. Because the working directory can vary as well I can't think of a way to reliably get the fullpath...

Reverse DNS lookup in perl

How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl? ...

Where does CGI.pm normally create temporary files?

On all my Windows servers, except for one machine, when I execute the following code to allocate a temporary files folder: use CGI; my $tmpfile = new CGITempFile(1); print "tmpfile='", $tmpfile->as_string(), "'\n"; The variable $tmpfile is assigned the value '.\CGItemp1' and this is what I want. But on one of my servers it's incorrect...

Can I make Perl ithreads in Windows run concurrently?

I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQL*Plus sessions), each SQL*Plus session runs in order (i.e., thread 1's sqlplus runs steps 1-5, then thread 2's sqlplus runs steps 6-11, e...

Make git-svn work on Slackware 12.1

It is obviosly some Perl extensions. Perl version is 5.8.8. I found Error.pm, but now I'm looking for Core.pm. While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks. ...

How can I find the location of a regex match in Perl?

I need to write a function that receives a string and a regex. I need to check if there is a match and return the start and end location of a match. (the regex was already compiled by qr//) The function might also receive a "global" flag and then I need to return the (start,end) pairs of all the matches. ps. I cannot change the regex ...

How to get all file attributes including author, title, mp3 tags, etc, in one sweep

I would like to write all meta data (including advanced summary properties) for my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#) This can also be a script (vb, perl) Update: by looking at libextractor (thank you) I ...

How to replace $*=1 with an alternative now $* is no longer supported

Hi, I'm a complete perl novice, am running a perl script using perl 5.10 and getting this warning: $* is no longer supported at migrate.pl line 380. Can anyone describe what $* did and what the recommended replacement of it is now? Alternatively if you could point me to documentation that describes this that would be great. The scri...

Perl: why is the if statement slower than "and"?

In Perl, a conditional can be expressed either as if (condition) { do something } or as (condition) and do { do something } Interestingly, the second way seems to be about 10% faster. Does anyone know why? ...

Perl: variable scope issue with CGI & DBI modules

I've run into what appears to be a variable scope issue I haven't encountered before. I'm using Perl's CGI module and a call to DBI's do() method. Here's the code structure, simplified a bit: use DBI; use CGI qw(:cgi-lib); &ReadParse; my $dbh = DBI->connect(...............); my $test = $in{test}; $dbh->do(qq{INSERT INTO events VALUES (?...

Two Phase Commit/Shared Transaction

The scenario is this We have two applications A and B, both which are running in separate database (Oracle 9i ) transactions Application A - inserts some data into the database, then calls Application B Application B - inserts some data into the database, related (via foreign keys) to A's data. Returns an "ID" to Application A Applicat...

How can I read and manipulate PDF 1.5 files in Perl?

There doesn't appear to be any Perl libraries that can open, manipulate, and re-save PDF documents that use the newer PDF version (1.5 and above I believe) that use a cross-reference stream rather than table. Does anyone know of any unix/linux-based utilities to convert a PDF to an older version? Or perhaps there's a Perl module in CPA...

Perl::Critic: Life after Moose?

I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each each other as much as they used to. Are there docs anywhere on how to make critic/tidy be more appreciative if the Moose dialect? What do most Moose users do? Relax/ditch ...