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
Share this Page URL
Help

8. Using Object-Oriented Modules > Modules and Their Functional Interfaces

Modules and Their Functional Interfaces

Modules are the primary mechanism for bundling up Perl code for later use by yourself or others. As I’m sure you can’t help noticing from reading The Perl Journal, CPAN (the Comprehensive Perl Archive Network) is the repository for modules that others have written, for anything from composing music to downloading web pages. Many modules are bundled with every installation of Perl.

Text::Wrap is one module you may have used that has a fairly typical interface. It comes with Perl, so you don’t even need to install it from CPAN. You use it in a program by having your program say:

	use Text::Wrap;

After that, you can access a function called wrap, which inserts linebreaks in text that you feed it, so that the text will be wrapped to 72 (or however many) columns.


  

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