当前位置: 首页 > 资源下载 > 编程语言 > 查看资源

资源分类
Web开发
Java
.NET
编程语言
数据库
软件工程
图形动画
系统管理
网络通信安全
计算机理论
考试认证
人文百科
文档手册
硬件技术
办公软件

Higher-Order Perl

Higher-Order Perl

书名:Higher-Order Perl

上传:石头

时间:2010-01-09

文件大小:1.66 MB

资源出处:查看资源出处 >>

收藏到网摘: n/a



作者:Mark Jason Dominus
出版社:其它
页数:582
ISBN:ISBN 1558607013, 9781558607019
文件格式:PDF

Higher-Order Perl is about functional programmingtechniques in Perl. It’s about how to write functions that can modifyand manufacture other functions.
It’s difficult to explain briefly exactly what this means—it’s as if
someone was writing a book about object-oriented programming in 1982
when hardly anyone had heard of object-oriented programming.
Obviously, functional programming isn’t simply programming with
functions, because everyone does that already. Perhaps the best summary is
that it’s about writing functions that can manufacture other
functions.–>

Why would you want to do that? Because that way your code ismore flexible and more reusable. Instead of writing ten similarfunctions, you write a general pattern or framework that can generatethe functions you want; then you generate just the functions you needaccording to the pattern. The program doesn’t need to know in advancewhich functions are necessary; it can generate them as needed. Insteadof writing the complete program yourself, you get the computer to writeit for you.
HOP is full of useful and interesting examples that Perl programmerswill want to see. Chapter 1 is about writing recursive functions towalk the file system and to process recursively-structured data such asHTML documents. Chapter 2 discusses dispatch tables in the context ofreading configuration files. Chapter 4 concludes with an improvedreplacement for the WWW::SimpleRobot module, with better functionalityin one-third the code, and also contains a basic database query systemthat searches an HTTP log file backwards, delivering the most recentrecords first. Chapter 6 discusses the frequently asked question of howto generate a list of all the strings that will match a given regex andprovides an astonishingly simple solution. Later on, in Chapter 8, Ishow how to build a parser for regexes and attach it to the stringgenerator. Chapter 9 presents linogram, a complete constraint-baseddiagram-drawing system.
Tags:Perl


相关书籍

  • Practical mod_perl
  • Network Programming with Perl
  • Perl by Example (4th Edition)
  • Learning Perl, Fourth Edition
  • Perl by Example (4th Edition)

评论 (0) All

登陆 | 还没注册?