Programming Perl

Total Page:16

File Type:pdf, Size:1020Kb

Programming Perl Programming the Perl DBI Alligator Descartes & Tim Bunce First Edition February 2000 ISBN: 1-56592-699-4, 350 pages The primary interface for database programming in Perl is DBI. Programming the Perl DBI is coauthored by Alligator Descartes, one of the most active members of the DBI community, and by Tim Bunce, the inventor of DBI. The book explains the architecture of DBI, shows you how to write DBI- based programs and explains both DBI's nuances and the peculiarities of each individual DBD. This is the definitive book for database programming in Perl. Table of Contents Preface 1 1. Introduction 5 From Mainframes to Workstations Perl DBI in the Real World A Historical Interlude and Standing Stones 2. Basic Non-DBI Databases 9 Storage Managers and Layers Query Languages and Data Functions Standing Stones and the Sample Database Flat-File Databases Putting Complex Data into Flat Files Concurrent Database Access and Locking DBM Files and the Berkeley Database Manager The MLDBM Module Summary 3. SQL and Relational Databases 41 The Relational Database Methodology Datatypes and NULL Values Querying Data Modifying Data Within Tables Creating and Destroying Tables 4. Programming with the DBI 57 DBI Architecture Handles Data Source Names Connection and Disconnection Error Handling Utility Methods and Functions 5. Interacting with the Database 76 Issuing Simple Queries Executing Non-SELECT Statements Binding Parameters to Statements Binding Output Columns do( ) Versus prepare( ) Atomic and Batch Fetching 6. Advanced DBI 97 Handle Attributes and Metadata Handling LONG/LOB Data Transactions, Locking, and Isolation Table of Contents (cont...) 7. ODBC and the DBI 116 ODBC-Embraced and Extended DBI-Thrashed and Mutated The Nuts and Bolts of ODBC ODBC from Perl The Marriage of DBI and ODBC Questions and Choices Moving Between Win32::ODBC and the DBI And What About ADO? 8. DBI Shell and Database Proxying 122 dbish-The DBI Shell Database Proxying A. DBI Specification 131 B. Driver and Database Characteristics 171 C. ASLaN Sacred Site Charter 249 Colophon 250 Author Interview 251 Description One of the greatest strengths of the Perl programming language is its ability to manipulate large amounts of data. Database programming is therefore a natural fit for Perl, not only for business applications but also for CGI-based web and intranet applications. The primary interface for database programming in Perl is DBI. DBI is a database-independent package that provides a consistent set of routines regardless of what database product you use - Oracle, Sybase, Ingres, Informix, you name it. The design of DBI is to separate the actual database drivers (DBDs) from the programmer's API, so any DBI program can work with any database, or even with multiple databases by different vendors simultaneously. Programming the Perl DBI is coauthored by Alligator Descartes, one of the most active members of the DBI community, and by Tim Bunce, the inventor of DBI. For the uninitiated, the book explains the architecture of DBI and shows you how to write DBI-based programs. For the experienced DBI dabbler, this book reveals DBI's nuances and the peculiarities of each individual DBD. The book includes: • An introduction to DBI and its design • How to construct queries and bind parameters • Working with database, driver, and statement handles • Debugging techniques • Coverage of each existing DBD • A complete reference to DBI This is the definitive book for database programming in Perl. Programming the Perl DBI Preface The DBI is the standard database interface for the Perl programming language. The DBI is database- independent, which means that it can work with just about any database, such as Oracle, Sybase, Informix, Access, MySQL, etc. While we assume that readers of this book have some experience with Perl, we don't assume much familiarity with databases themselves. The book starts out slowly, describing different types of databases and introducing the reader to common terminology. This book is not solely about the DBI - it also concerns the more general subject of storing data in and retrieving data from databases of various forms. As such, this book is split into two related, but standalone, parts. The first part covers techniques for storing and retrieving data without the DBI, and the second, much larger part, covers the use of the DBI and related technologies. Throughout the book, we assume that you have a basic grounding in programming with Perl and can put together simple scripts without instruction. If you don't have this level of Perl awareness, we suggest that you read some of the Perl books listed in Section P.1. Once you're ready to read this book, there are some shortcuts that you can take depending on what you're most interested in reading about. If you are interested solely in the DBI, you can skip Chapter 2 without too much of a problem. On the other hand, if you're a wizard with SQL, then you should probably skip Chapter 3 to avoid the pain of us glossing over many fine details. Chapter 7 is a comparison between the DBI and ODBC and is mainly of interest to database geeks, design aficionados, and those people who have Win32::ODBC applications and are desperately trying to port them to DBI. Here's a rundown of the book, chapter by chapter: Chapter 1 This introduction sets up the general feel for the book. Chapter 2 This chapter covers the basics of storing and retrieving data either with core Perl functions through the use of delimited or fixed-width flat-file databases, or via non-DBI modules such as AnyDBM_File, Storable, Data::Dumper and friends. Although the DBI isn't used in this chapter, the way the Storable and Data::Dumper modules are used to pack Perl data structures into strings can easily be applied to the DBI. Chapter 3 This chapter is a basic overview of SQL and relational databases and how you can write simple but powerful SQL statements to query and manipulate your database. If you already know some SQL, you can skip this chapter. If you don't know SQL, we advise you to read this chapter since the later chapters assume you have a basic knowledge of SQL and relational databases. Chapter 4 This chapter introduces the DBI to you by discussing the architecture of the DBI and basic DBI operations such as connecting to databases and handling errors. This chapter is essential reading and describes the framework that the DBI provides to let you write simple, powerful, and robust programs. Chapter 5 This chapter is the meat of the DBI topic and discusses manipulating the data within your database - that is, retrieving data already stored in your database, inserting new data, and deleting and updating existing data. We discuss the various ways in which you can perform these operations from the simple "get it working" stage to more advanced and optimized techniques for manipulating data. page 1 Programming the Perl DBI Chapter 6 This chapter covers more advanced topics within the sphere of the DBI such as specifying attributes to fine-tune the operation of DBI within your applications, working with LONG/LOB datatypes, statement and database metadata, and finally transaction handling. Chapter 7 This chapter discusses the differences in design between DBI and ODBC, the other portable database API. And, of course, this chapter highlights why DBI is easier to program with. Chapter 8 This chapter covers two topics that aren't exactly part of the core DBI, per se, but are extremely useful to know about. First, we discuss the DBI shell, a command-line tool that allows you to connect to databases and issue arbitrary queries. Second, we discuss the proxy architecture that the DBI can use, which, among other things, allows you to connect scripts on one machine to databases on another machine without needing to install any database networking software. For example, you can connect a script running on a Unix box to a Microsoft Access database running on a Microsoft Windows box. Appendix A This appendix contains the DBI specification, which is distributed with DBI.pm. Appendix B This appendix contains useful extra information on each of the commonly used DBDs and their corresponding databases. Appendix C This appendix contains the charter for the Ancient Sacred Landscape Network, which focuses on preserving sites such as the megalithic sites used for examples in this book. Resources To help you navigate some of the topics in this book, here are some resources that you might want to check out before, during, and after reading this book: http://www.symbolstone.org/technology/perl/DBI The DBI home page. This site contains lots of useful information about DBI and where to get the various modules from. It also has links to the very active dbi-users mailing list and archives. http://www.perl.com/CPAN This site includes the Comprehensive Perl Archive Network multiplexer, upon which you find a whole host of useful modules including the DBI. An Introduction to Database Systems, by C. J. Date This book is the standard textbook on database systems and is highly recommended reading. A Guide to the SQL Standard, by C. J. Date and Hugh Darwen An excellent book that's detailed but small and very readable. http://w3.one.net/~jhoffman/sqltut.htm http://www.jcc.com/SQLPages/jccs_sql.htm http://www.contrib.andrew.cmu.edu/~shadow/sql.html These web sites contain information, specifications, and links on the SQL query language, of which we present a primer in Chapter 3. Further information can be found by entering "SQL tutorial" or similar expressions into your favorite web search engine. Learning Perl, by Randal Schwartz and Tom Christiansen A hands-on tutorial designed to get you writing useful Perl scripts as quickly as possible.
Recommended publications
  • Learning to Program in Perl
    Learning to Program in Perl by Graham J Ellis Languages of the Web Learning to Program in Perl version 1.7 Written by Graham Ellis [email protected] Design by Lisa Ellis Well House Consultants, Ltd. 404, The Spa, Melksham, Wiltshire SN12 6QL England +44 (0) 1225 708 225 (phone) +44 (0) 1225 707 126 (fax) Find us on the World Wide Web at: http://www.wellho.net Or contact us at: [email protected] Copyright © 2003 by Well House Consultants, Ltd. Printed in Great Britain. Printing History May 1999 1.0 First Edition February 2000 1.1 Minor additions June 2000 1.2 Compliation of modules October 2000 1.3 Name change, revisions April 2002 1.4 Added modules September 2002 1.5 Added modules January 2003 1.6 Updated modules February 2003 1.7 Updated modules This manual was printed on 21 May 2003. Notice of Rights All rights reserved. No part of this manual, including interior design, may be reproduced or translated into any language in any form, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without prior written permission of Well House Consultants except in the case of brief quotations embodied in critical articles and reviews. For more information on getting permission for reprints and excerpts, contact Graham Ellis at Well House Consultants. This manual is subject to the condition that it shall not, by way of trade or otherwise, be lent, sold, hired out or otherwise circulated without the publisher's prior consent, incomplete nor in any form of binding or cover other than in which it is published and without a similar condition including this condition being imposed on the subsequent receiver.
    [Show full text]
  • How to Secure Your Web Site Picked up SQL Injection and Cross-Site Scripting As Sample Cases of Failure Because These Two Are the Two Most Reported Vulnerabilities
    How to Secure your Website rd 3 Edition Approaches to Improve Web Application and Web Site Security June 2008 IT SECURITY CENTER (ISEC) INFORMATION-TECHNOLOGY PROMOTION AGENCY, JAPAN This document is a translation of the original Japanese edition. Please be advises that most of the references referred in this book are offered in Japanese only. Both English and Japanese edition are available for download at: http://www.ipa.go.jp/security/english/third.html (English web page) http://www.ipa.go.jp/security/vuln/websecurity.html (Japanese web page) Translated by Hiroko Okashita (IPA), June 11 2008 Contents Contents ......................................................................................................................................... 1 Preface ........................................................................................................................................... 2 Organization of This Book ........................................................................................................... 3 Intended Reader ......................................................................................................................... 3 Fixing Vulnerabilities – Fundamental Solution and Mitigation Measure - .................................... 3 1. Web Application Security Implementation ............................................................................... 5 1.1 SQL Injection .................................................................................................................... 6 1.2
    [Show full text]
  • Red Hat Enterprise Linux 8 Installing, Managing, and Removing User-Space Components
    Red Hat Enterprise Linux 8 Installing, managing, and removing user-space components An introduction to AppStream and BaseOS in Red Hat Enterprise Linux 8 Last Updated: 2021-06-25 Red Hat Enterprise Linux 8 Installing, managing, and removing user-space components An introduction to AppStream and BaseOS in Red Hat Enterprise Linux 8 Legal Notice Copyright © 2021 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
    [Show full text]
  • Perl DBI API Reference
    H Perl DBI API Reference This appendix describes the Perl DBI application programming interface. The API consists of a set of methods and attributes for communicating with database servers and accessing databases from Perl scripts. The appendix also describes MySQL-specific extensions to DBI provided by DBD::mysql, the MySQL database driver. I assume here a minimum version of DBI 1.50, although most of the material applies to earlier versions as well. DBI 1.50 requires at least Perl 5.6.0 (with 5.6.1 preferred). As of DBI 1.611, the minimum Perl version is 5.8.1. I also assume a minimum version of DBD::mysql 4.00. To determine your versions of DBI and DBD::mysql (assuming that they are installed), run this program: #!/usr/bin/perl # dbi-version.pl - display DBI and DBD::mysql versions use DBI; print "DBI::VERSION: $DBI::VERSION\n"; use DBD::mysql; print "DBD::mysql::VERSION: $DBD::mysql::VERSION\n"; If you need to install the DBI software, see Appendix A , “Software Required to Use This Book.” Some DBI methods and attributes are not discussed here, either because they do not apply to MySQL or because they are experimental methods that may change as they are developed or may even be dropped. Some MySQL-specific DBD methods are not discussed because they are obsolete. For more information about new or obsolete methods, see the DBI or DBD::mysql documentation, available at http://dbi.perl.org or by running the following commands: % perldoc DBI % perldoc DBI::FAQ % perldoc DBD::mysql The examples in this appendix are only brief code fragments.
    [Show full text]
  • Accessing DB from Programming Languages
    Accessing DB from programming languages JDBCJDBC andand ODBCODBC • API (application-program interface) for a program to interact with a database server • Application makes calls to – Connect with the database server – Send SQL commands to the database server – Fetch tuples of result one-by-one into program variables • ODBC (Open Database Connectivity) works with C, C++, C#, and Visual Basic – Other API’s such as ADO.NET sit on top of ODBC • JDBC (Java Database Connectivity) works with Java JDBCJDBC • JDBC is a Java API for communicating with database systems supporting SQL. • JDBC supports a variety of features for querying and updating data, and for retrieving query results. • JDBC also supports metadata retrieval, such as querying about relations present in the database and the names and types of relation attributes. • Model for communicating with the database: – Open a connection – Create a “statement” object – Execute queries using the Statement object to send queries and fetch results – Exception mechanism to handle errors JDBCJDBC CodeCode public static void JDBCexample(String dbid, String userid, String passwd) { try { Class.forName ("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@db.yale.edu:2000:univdb", userid, passwd); Statement stmt = conn.createStatement(); … Do Actual Work …. stmt.close(); conn.close(); } catch (SQLException sqle) { System.out.println("SQLException : " + sqle); } } JDBCJDBC CodeCode (Cont.)(Cont.) • Update to database try { stmt.executeUpdate( "insert
    [Show full text]
  • Insert Query in Java Using Prepared Statement
    Insert Query In Java Using Prepared Statement Overriding Ike reflates impartially while Barton always triturates his oftenness interpages faithfully, he mistrusts so boyishly. Piet remains circumfluous after Wade locate definably or decentralised any definition. Zacherie is aristocratically large-minded after scrubbier Stillman break-outs his sexes sketchily. By allowing the standard access to create a prepared statements quickly delete data is registered list of query in using insert java prepared statement affecting the stored procedure Stmt db-prepareINSERT INTO foo firstname lastname email VALUES. All these source stuff and easily switch to understand your name in cleanup after the insert statement is part of user row can add to above tutorial in. Previously he spares his picture might require that counted the using insert query in java statement can be grouped in statement and respond to. An interest in case of data expected by the member, we check the program to advancing racial equity for using insert query that does it. To teach good coding world through this clause if it behave in prepared insert query statement in java using a later filled with technological advances. Java PreparedStatement javatpoint. When people prepare the statement Cassandra parses the folder string caches the result. To distress an INSERT statement against multiple rows the normal method is to commend a. Java JDBC Tutorial Inserting Data with User Input luv2code. Update PostgreSQL Record using Prepared Statement in Java. To insert a service in school table using PreparedStatement in Java you need not use below syntax to. The typical workflow of using a prepared statement is as follows.
    [Show full text]
  • Automated Fix Generator for SQL Injection Attacks
    Automated Fix Generator for SQL Injection Attacks Fred Dysart and Mark Sherriff Department of Computer Science, University of Virginia, Charlottesville, VA 22903 {ftd4q, sherriff}@virginia.edu Abstract Thomas’s solution, any variable that defines a prepared A critical problem facing today’s internet community statement’s structure must be within the same scope as is the increasing number of attacks exploiting flaws the execution of that statement. Our solution does not found in Web applications. This paper specifically incur this limitation because the generation of the targets input validation vulnerabilities found in SQL prepared statement fix is not dependant on the actual queries that may lead to SQL Injection Attacks statement declaration in the code. (SQLIAs). We introduce a tool that automatically detects and suggests fixes to SQL queries that are found 3. SecurePHP to contain SQL Injection Vulnerabilities (SQLIVs). Our solution is called SecurePHP. It was written in Testing was performed against phpBB v2.0, an open C# and utilized the .NET framework. There were two source forum package, to determine the accuracy and main design decisions that guided us through efficacy of our software. development. First, we wanted the tool to be easy to use. While all applications should be simple for a user 1. Introduction to interact with, the reasoning behind our decision was According to the National Institute of Standards and that the increasing amount of SQLIVs present in Technology, SQL Injection Vulnerabilities (SQLIVs) software might be from legacy software that is not amounted 14% of the total Web application maintained by a developer with experience fixing vulnerabilities in 2006 [3].
    [Show full text]
  • TIBCO® Data Virtualization Client Interfaces Guide Version 7.0.6
    TIBCO® Data Virtualization Client Interfaces Guide Version 7.0.6 Last Updated: November 20, 2017 Important Information SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIBCO and the TIBCO logo are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries TIBCO, Two-Second Advantage, TIBCO Spotfire? TIBCO ActiveSpaces, TIBCO Spotfire Developer, TIBCO EMS, TIBCO Spotfire Automation Services, TIBCO Enterprise Runtime for R, TIBCO Spotfire Server, TIBCO Spotfire Web Player, TIBCO Spotfire Statistics Services, S-PLUS, and TIBCO Spotfire S+ are either registered trademarks or trademarks of TIBCO Software Inc.
    [Show full text]
  • Mysql Workbench Abstract
    MySQL Workbench Abstract This is the MySQL Workbench Reference Manual. It documents the MySQL Workbench Community and MySQL Workbench Commercial releases for versions 8.0 through 8.0.26. If you have not yet installed the MySQL Workbench Community release, please download your free copy from the download site. The MySQL Workbench Community release is available for Microsoft Windows, macOS, and Linux. MySQL Workbench platform support evolves over time. For the latest platform support information, see https:// www.mysql.com/support/supportedplatforms/workbench.html. For notes detailing the changes in each release, see the MySQL Workbench Release Notes. For legal information, including licensing information, see the Preface and Legal Notices. For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users. Document generated on: 2021-09-24 (revision: 70892) Table of Contents Preface and Legal Notices ................................................................................................................ vii 1 General Information ......................................................................................................................... 1 1.1 What Is New in MySQL Workbench ...................................................................................... 1 1.1.1 New in MySQL Workbench 8.0 Release Series ........................................................... 1 1.1.2 New in MySQL Workbench 6.0 Release Series ..........................................................
    [Show full text]
  • Other Topics 1 Other Topics
    Other topics 1 Other topics 1 Other topics 15 Feb 2014 1 1.1 Description 1.1 Description Where to learn more about other topics that are useful for mod_perl developers and users. 1.2 Perl The Perl Documentation http://perldoc.perl.org/ The Perl Home Page http://www.perl.com/ The Perl Monks http://www.perlmonks.org/ What Perl Monks is: Our attempt to make learning Perl as nonintimidating and easy to use as possi- ble. A place for you and others to polish, improve, and showcase your Perl skills. A community which allows everyone to grow and learn from each other. The Perl Journal http://www.tpj.com/ The Perl Review http://theperlreview.com/ The Perl Review is a magazine for the Perl community by the Perl community produced with open source tools. CPAN - Comprehensive Perl Archive Network http://cpan.org and http://search.cpan.org/ Perl Module Mechanics http://world.std.com/~swmcd/steven/perl/module_mechanics.html - This page describes the mechan- ics of creating, compiling, releasing and maintaining Perl modules. Creating (and Maintaining) Perl Modules http://www.mathforum.com/~ken/perl_modules.html XS tutorials 2 15 Feb 2014 Other topics 1.3 Perl/CGI Perl manpages: perlguts, perlxs, and perlxstut manpages. Dean Roehrich’s XS CookBookA and CookBookB http://search.cpan.org/search?dist=CookBookA http://search.cpan.org/search?dist=CookBookB a series of articles by Steven McDougall: http://world.std.com/~swmcd/steven/perl/pm/xs/intro/index.html http://world.std.com/~swmcd/steven/perl/pm/xs/concepts.html http://world.std.com/~swmcd/steven/perl/pm/xs/tools/index.html http://world.std.com/~swmcd/steven/perl/pm/xs/modules/modules.html http://world.std.com/~swmcd/steven/perl/pm/xs/nw/NW.html Advanced Perl Programming By Sriram Srinivasan.
    [Show full text]
  • Perl Variables Scalar ($) Array (@) Hash (%)
    Practical Extraction and Report Language « Perl is a language of getting your job done » « There is more than one way to do it » Larry Wall VI, October 2006 Page 1 Perl Outline : History Structure of a simple Perl script Perl variables scalar ($) array (@) hash (%) Operators (numeric, string & logical) Statement modifiers (if/elsif/else, for/foreach, while) VI, October 2006 Page 2 Practical Extraction and Report Language http://perl.oreilly.com " Perl is both a programming language and an application on your computer that runs those programs " VI, October 2006 Page 3 Perl history A few dates: 1969 UNIX was born at Bell Labs. 1970 Brian Kernighan suggested the name "Unix" and the operating system we know today was born. 1972 The programming language C is born at the Bell Labs (C is one of Perl's ancestors). 1973 “grep” is introduced by Ken Thompson as an external utility: Global REgular expression Print. 1976 Steven Jobs and Steven Wozniak found Apple Computer (1 April). 1977 The computer language awk is designed by Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan (awk is one of Perl's ancestors). VI, October 2006 Page 4 Perl history 1987 Perl 1.000 is unleashed upon the world NAME perl | Practical Extraction and Report Language SYNOPSIS perl [options] filename args DESCRIPTION Perl is a interpreted language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).
    [Show full text]
  • Name Description
    Perl version 5.10.0 documentation - perlnewmod NAME perlnewmod - preparing a new module for distribution DESCRIPTION This document gives you some suggestions about how to go about writingPerl modules, preparing them for distribution, and making them availablevia CPAN. One of the things that makes Perl really powerful is the fact that Perlhackers tend to want to share the solutions to problems they've faced,so you and I don't have to battle with the same problem again. The main way they do this is by abstracting the solution into a Perlmodule. If you don't know what one of these is, the rest of thisdocument isn't going to be much use to you. You're also missing out onan awful lot of useful code; consider having a look at perlmod, perlmodlib and perlmodinstall before coming back here. When you've found that there isn't a module available for what you'retrying to do, and you've had to write the code yourself, considerpackaging up the solution into a module and uploading it to CPAN so thatothers can benefit. Warning We're going to primarily concentrate on Perl-only modules here, ratherthan XS modules. XS modules serve a rather different purpose, andyou should consider different things before distributing them - thepopularity of the library you are gluing, the portability to otheroperating systems, and so on. However, the notes on preparing the Perlside of the module and packaging and distributing it will apply equallywell to an XS module as a pure-Perl one. What should I make into a module? You should make a module out of any code that you think is going to beuseful to others.
    [Show full text]