perl

How to get hashes out of arrays in Perl?

I want to write a little "DBQuery" function in perl so I can have one-liners which send an SQL statement and receive back and an array of hashes, i.e. a recordset. However, I'm running into an issue with Perl syntax (and probably some odd pointer/reference issue) which is preventing me from packing out the information from the hash that ...

Are there any good automated frameworks for applying coding standards in Perl?

One I am aware of is Perl::Critic And my googling has resulted in no results on multiple attempts so far. :-( Does anyone have any recommendations here? Any resources to configure Perl::Critic as per our coding standards and run it on code base would be appreciated. ...

Is there any way to enable code completion for Perl in vim?

Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions. Is there any way to enable code completion for Perl in vim? ...

What is your favorite IDE for Perl development?

What is your favorite IDE for Perl development and why? Here are the choices so far: Vim EPIC + UltraEdit VIM TextMate E Komodo Emacs TextPad Padre XEmacs WordPad Jedit Nedit SlickEdit Cream Trinity MacVim ...

What does Class::MethodMaker exactly do?

I want to know what exactly is the sequence of calls when a getter/setter created through Class::MethodMaker is called? How costlier are getter/setters defined by MethodMaker than the native ones(overwritten in the module)? ...

Reading data from a log file as a separate application is writing to it.

I would like to monitor a log file that is being written to by an application. I want to process the file line by line as, or shortly after, it is written. I have not found a way of detecting that a file has been extended after reaching eof. The code needs to work on Mac and PC, and can be in any language, though I am most familiar with...

How do I call MySQL stored procedures from Perl?

How do I call MySQL stored procedures from Perl? Stored procedure functionality is fairly new to MySQL and the MySQL modules for Perl don't seem to have caught up yet. ...

How do I create graphs in Perl on Windows?

How do I use Perl to create graphs? I'm running scheduled job that creates text reports. I'd like to move this to the next step (for the management) and also create some graphs that go along with this. Is this possible / feasible? It'd be great if I could do this using Office some how. update: solutions i'm going to investigate in ...

What's the easiest way to install a missing Perl module?

I get this error: Can't locate Foo.pm in @INC Is there an easier way to install it than downloading, untarring, making, etc? ...

What is the best way to extract a version string from a file?

I want to use a file to store the current version number for a piece of customer software which can be used by a start-up script to run the binary in the correct directory. For Example, if the run directory looks like this: . .. 1.2.1 1.2.2 1.3.0 run.sh current_version And current_version contains: 1.2.2 I want run.sh to descend i...

What's happening with Perl 6?

Is there any visible progress? Is it now just an academic exercise? Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten? ...

Perl aids for regression testing

Is there a Perl module that allows me to view diffs between actual and reference output of programs (or functions)? The test fails if there are differences. Also, in case there are differences but the output is OK (because the functionality has changed) I want to be able to commit the actual output as future reference output. ...

Perl Sys::Syslog on Solaris

Has anyone got Sys::Syslog to work on Solaris? (I'm running Sys::Syslog 0.05 on Perl v5.8.4 on SunOS 5.10 on SPARC). Here's what doesn't work for me: openlog "myprog", "pid", "user" or die; syslog "crit", "%s", "Test from $0" or die; closelog() or warn "Can't close: $!"; system "tail /var/adm/messages"; Whatever I do, the closelog r...

List comparison

I use this question in interviews and I wonder what the best solution is. Write a Perl sub that takes n lists, and then returns 2^n-1 lists telling you which items are in which lists; that is, which items are only in the first list, the second, list, both the first and second list, and all other combinations of lists. Assume that n is r...

What's the best online source to learn Perl?

I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl? ...

Is there a good obfuscater for Perl code?

Does anyone know of a good code obsfucator for Perl? I'm being ask to look into the option of obsfucating code before releasing it to a client. I know obsfucated code can still be reverse engineered, but that's not our main concern. Some clients are making small changes to the source code that we give them and it's giving us nightmares...

Which version of Perl should I use on Windows?

The win32.perl.org web site provides references to several Perl distributions for MS Windows. For a long time I have been using ActivePerl from ActiveState but recently I switched to Strawberry Perl. IMHO The only advantage that Active Perl still has over Strawberry Perl is the fact that it comes with Perl Tk which means its easy to ...

How can I check for a file size and add that result in an Excel spreadsheet in Perl?

Currently I monitoring a particular file with a simple shell one-liner: filesize=$(ls -lah somefile | awk '{print $5}') I'm aware that Perl has some nice modules to deal with Excel files so the idea is to, let's say, run that check daily, perhaps with cron, and write the result on a spreadsheet for further statistical use. ...

How should I capitalize Perl?

PERL? Perl? perl? What's good style? I know the answerI just wanted to make sure the question was out there and questioners were aware that there is a correct form. ...

What's the point of Perl golf?

Perl golf is a programmers' game which involves solving a problem with the shortest perl program possible. (ie, the winner is the person who completes the round in the lowest number of (key)strokes). ...