Skip to Content
Advanced Perl Programming, 2nd Edition
book

Advanced Perl Programming, 2nd Edition

by Simon Cozens
June 2005
Intermediate to advanced
298 pages
7h 28m
English
O'Reilly Media, Inc.
Content preview from Advanced Perl Programming, 2nd Edition

Chapter 7. POE

In this chapter, we’re going to look at what Mark-Jason Dominus called “the most interesting development in Perl 5”: the Perl Object Environment. POE has many goals and many uses; to give a few of them:

  • Provide a cooperative scheduling and multitasking environment rivalling threads and IPC

  • Simplify the development of protocol-driven network clients and servers

  • Provide an architecture for creating state machines

  • Abstract away a lot of the boring I/O details from complex programs

As you can see, POE is a difficult thing to describe,[*] but the main point is that POE attempts to hide the menial details of event-driven programming.

Programming in an Event-Driven Environment

If you’ve ever programmed a graphical application using something like Tk or Gtk, you’ll know that it’s a little different than ordinary procedural programming. In normal programming, you write a sequence of things you’d like the program to do, and it does them. However, GUIs don’t work like that—instead, you set up an environment (a window, for instance) that responds to certain events (clicking a button or selecting a menu item). This is called the event-driven paradigm .

It’s not just GUIs that use this paradigm. For example, a network server does not do a sequence of events, but it sits waiting for a connection (an event), and then services the connection depending on the input from the client. When the client is done and disconnects, it goes back to waiting for the next event.

Similarly, you could write ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Advanced Perl Programming

Advanced Perl Programming

Sriram Srinivasan
Learning Perl, 6th Edition

Learning Perl, 6th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix
Intermediate Perl, 2nd Edition

Intermediate Perl, 2nd Edition

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 0596004567Errata Page