Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

18.4. Oops

But not quite yet. Soon after I began writing this script I discovered that the chat2.pl library, which was originally written for Perl 4, hasn’t been brought up to date for a long time. As a result, it’s not as portable as other parts of Perl 5. chat2.pl uses a number of system-specific constants for creating sockets and pseudo ttys. Some of the constants are obtained from .ph files (system include files that have been run through the h2ph converter), while others are, unfortunately, hard coded. h2ph is notoriously difficult to run correctly, and the .ph files it produces often have to be tuned by hand. Worse, the hardcoded value for one essential constant, TIOCNOTTY, was just plain wrong for my Linux system, causing chat2.pl to fail miserably.

To get things working, I patched my copy of chat2.pl slightly to bring it up to date. The patch replaces hardwired and .ph constants with ones imported from the Socket.pm and Ioctl.pm modules. You can find a copy of this patch file on the web site for this book.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint