Main Navigation

Content

Perl for Multitasking and Networking

Learn Perl Now!
And get a job doing Perl.

Introduction

In multitasking, the program performs several tasks at once. Multitasking is closely related to networking where we have to handle several events or serve several clients at once.

Technologies of Interest

IPC-Run

A module that allows one to run background processes with piping, and ptys. Works on UNIXes as well as Windows.

Expect

Allows one to control a terminal application interactively and wait for events.

Parallel-ForkManager

A simple way to parallelise tasks. Also see AnyEvent-ForkManager (see below for AnyEvent).

Event Driven Programming Frameworks

There are several frameworks available for event driven programming, cooperative multitasking and writing network applications. You can find the most important and most recommended ones on CPAN. Here is a list of some of the most recommended ones.

POE: Perl Object Environment

POE was one of the first event-driven programming frameworks for Perl, and gained some popularity in part due to lack of alternatives. Its style is baroque and as such it may no longer be recommended.

AnyEvent

AnyEvent is a more modern events’ framework and allows one to make use of extensions for other frameworks. It is also fast.

IO-Async

A popular framework for asynchronous events on CPAN.

Threads?

Many people are tempted to use threads with Perl and Internet forums are constantly frequented for help with threads in Perl. However, the use of Perl in threads is not recommended:

Share/Bookmark

Sidebar

Footer