Skip to Content
Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition
book

Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition

by Joseph N. Hall, Joshua A. McAdams, brian d foy
April 2010
Intermediate to advanced
504 pages
9h 56m
English
Addison-Wesley Professional
Content preview from Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition

4. Subroutines

A big part of Perl’s power as a dynamic language comes from its malleable subroutines. You don’t have to do much to define a subroutine. You don’t have to tell it how many parameters it will receive, or what types of data you will give it. You can pass a subroutine any list that you like and figure out what to do with it later. Although Perl is very permissive and gives you plenty of flexibility to decide things as late as possible. Despite that, there is a lot that you can do to keep yourself from being too flexible.

You don’t even have to define subroutines ahead of time, either. You can make new ones at run time and you can even redefine them later. You can write subroutines that create other subroutines. Each of those subroutines ...

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.
Start your free trial

You might also like

Advanced Perl Programming

Advanced Perl Programming

Sriram Srinivasan
Perl in a Nutshell, 2nd Edition

Perl in a Nutshell, 2nd Edition

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl Best Practices

Perl Best Practices

Damian Conway
Perl by Example

Perl by Example

Ellie Quigley

Publisher Resources

ISBN: 9780321718303Purchase book