The Perl Hub

Blog posts

Stack overflow

How to use regex match to find a string in an array of patterns?

Let's say I have an array of strings, e.g. @matches = ("cat", "zebra", "apple"), [...]

Perl - determine if an array is a subset of another array

I have the following code. Can isSubset be written simpler without add-on CPAN [...]

Calculate reward value based on percentage non-linearly?

I am programming a gambling type game where the rewards need to get bigger as th [...]

How to extract multiple tags with same name from an XML file in perl

My XML file looks like this: nuccore 133909243 [...]

print array of arrays with a separator

I have written a simple perl script: #!/usr/bin/perl use strict; use warnings; [...]

inserting data from perl into mysql

I'm trying to insert data produced by perl into an oracle database table using p [...]

Perl Foreach through Multidimensional Array?

I have a script that takes pathnames/files that are too old (as decided via user [...]

What is the value if you shift beyond the last element of an array?

In this piece of code, shift is used twice, even though the method only takes on [...]

Cartesian Product of two Strings

I am trying to write a function in Perl that computes the cross product (cartesi [...]

What do I use instead of JSON::RPC::Client?

I notice that JSON::RPC deprecated JSON::RPC::Client at version 1.0 . It looks [...]

how to create a script from a perl script which will use bash features to copy a directory structure

hi this is the part of the script which copies directory structure from source t [...]

Perl XML::Twig - preserving quotes in and around attributes

I'm selectively fixing some elements and attributes. Unfortunately, our input fi [...]

how can I split file into newlines using a delimiter?

Hi I have the following file: >AKJDHDLFNLDNFLNFRFMD >ALKSJLDKJSAD >GLH [...]

SIP UA proxy registration on demand?

I'm using the invite_and_send.pl script for the occasional reminder call, via SI [...]

Parse txt file using perl

I would like to parse a file containing data as below: 05\/26\/2013 06:09:47 \- [...]

How can I match a keyword and a filename with hash in perl?

I have a list of .txt files and a reference .csv file. My reference contains my [...]

Split Variable on white space

I'm trying to split a string into an array with the split occurring at the white [...]

How to do perl inline regex without setting to a variable?

Normally if you wish to change a variable with regex you do this: $string =~ s/ [...]

Perl: Why do i need to set the latin1 flag explicitly since JSON 2.xx?

Since JSON 2.xx i need to set the latin1 flag in order to get umlauts safe to th [...]

Parse file to get first occurance of unique lines

I need to parse a big file (more than 500 MB) and get unique lines. Indeed i nee [...]

mojolicious referencing a stash variable not always defined

I am still learning mojolicious and MVC frameworks in general so this just might [...]

Inserting element in an array of array in perl

Suppose i have a hash as below: my @A=( 1,2,[[ 1,2 ],[ 3,4,5 ]], [ 6,7,8 ]); [...]

perl optional command line argumnet

I am new to perl and wish to know the following logic if it works in perl :- I [...]

Module for converting number to month name in perl

My XML date input is : 2012-12-21 i.e. YYYY-MM-DD format. I want to convert mont [...]

Stick a `*` to the closest next word during the parsing

I have the following line in the text: int* a, b; The expected result is: in [...]

Perl: DBIx::Class Beginner - Subsetting Relationships and Prefetching

Okay, I'm new to DBIx::Class. I have a one-to-many relationship set up, like so: [...]

How do I build 32-bit XS modules for a 32-bit custom Perl on a 64-bit CentOS system?

I have a 64-bit CentOS 6 system running a custom-built version of Perl 5.12.5, t [...]

How to separate different values and make them variables

Want to separate different values and make them variables: db2 Attempting t [...]

Perl: Read 7 files and search for a word (the name of the files change constantly)

Every day I get a log file like: /home/ado/log/log.20130605 The log file conta [...]

Parsing tags from a file with Regexp::Grammars

I'm trying to capture free tags from comments in a program using Perl and the Re [...]

CPAN releases

App-XMMS2-Notifier-0.001

script which notifies you what xmms2 is playing

POE-Loop-AnyEvent-0.004

AnyEvent event loop support for POE

Astro-Catalog-4.27

A generic astronomical catalogue class

CPAN-Meta-2.131560

the distribution metadata for a CPAN dist

Mojolicious-Plugin-Blog-0.005

Mojolicious plugin for blog integration

Anansi-DatabaseComponent-0.02

A manager template for database drivers.

Mail-DMARC-1.20130605

Perl implementation of DMARC

Pod-Eventual-Reconstruct-0.1.2

Construct a document from Pod::Eventual events

Dist-Zilla-PluginBundle-Author-Plicease-0.99

Dist::Zilla plugin bundle used by Plicease

SQL-Bibliosoph-2.55

A SQL Query library

Module reviews

Catalyst-Runtime


I love catalyst!!! I've not worked so fast or had so much fun in ages [...]

true


Perfect to use with Syntax::Collector ! The modules i use in ALL my Perl files [...]

The-synthesizer


While I like Daft Punk as much as the next guy, this module doesn't belong here [...]

HTTP-Tiny


Very handy little module for when you just need HTTP. LWP::UserAgent is arguab [...]

App-perlbrew


I've recently used perlbrew to help debug a particular issue that was only occu [...]

String-String

scott: @foo = qw/a b c/; my $x = join //, @foo; leaves 'a1b1c' in $x (1 being th [...]

String-String


I found this because i was looking for elegant syantax for: $_{ join //, @arr [...]

Riak-Light


light, fast, easy to use, and flexible timeout. great !

App-SVN-Bisect


This is a very useful module which saved me hours. It is now firmly in my arse [...]

CGI


CGI.pm is the grand old man of Perl web programming. It is not generally consid [...]

Module ideas

DBI::Brev - framework for laconic DBI powered by DBIx::Connection, Config::General, SQL::SplitStatement

DBI::Brev provides framework for using DBI in more convenient & laconic way: 1 [...]

PGObject::Simple::Role - Moo/Moose role implementing PGObject::Simple interfaces

PGObject::Simple::Role arose out of a need for more formalized object structures [...]

Plack::Middleware::Redirect - Perform 301 redirects based on regexps

This module performs a redirect (HTML status code 301) for urls which match a li [...]

PGObject::Simple - A simple object method to stored procedure mapper

PGObject::Simple a top-half object system for PGObject which is simple and inspi [...]

PGObject - Toolkit for integrating PostgreSQL stored procedures into objects

PGObject contains the base routines for object management using discoverable sto [...]

Text::FrontMatter::YAML - Reads YAML Front Matter text format

Reads the "YAML front matter" format like you see in GitHub and Jekyll and vario [...]

MooseX::FileBased - Read and prepare parsing of file (or glob) data from some source

I often write modules to parse some specific file format for some specific task. [...]

App::Cmd::Tester::Untied - Capture the result of running an App::Cmd application using Capture::Tiny

One of the reasons that user-executed programs are so often poorly tested is tha [...]

File::Dropbox - Dropbox API abstraction (based on Tie::Handle)

`File::Dropbox` provides high-level Dropbox API abstraction based on `Tie::Handl [...]

Upcoming events

Perl QA Hackathon

12-14 April 2013

Dutch Perl Workshop

19 April 2013

Polish Perl Workshop

25-26 May 2013

YAPC North America

3-5 June 2013

OSCON 2013

22-26 July 2013

YAPC::Europe 2013

12-14 August 2013

YAPC::ASIA

19-21 September 2013

Recent talks

Dependency Injection

Doug Bell at Chicago.pm 2013-03-28

Introduction to OO Perl with Moose

Dave Cross at London Perl Workshop 2012

Perl memory use

Tim Bunce at YAPC Asia 2012

Perl tools for productivity

Tudor Constantin at YAPC::EU 2012

Baby XS to get you started

Joel Berger at YAPC::NA 2012

Statistics and Data Mining with PDL

Maggie Xiong at YAPC::NA 2012

How Perl changed my life

Gosuke Miyashita

Play-Perl quests