وبلاگ بلیان

Effective Perl Programming: Ways to Write Better, More Idiomatic Perl (Effective Software Development Series)

جلد کتاب Effective Perl Programming: Ways to Write Better, More Idiomatic Perl (Effective Software Development Series)

معرفی کتاب «Effective Perl Programming: Ways to Write Better, More Idiomatic Perl (Effective Software Development Series)» نوشتهٔ Hall J.N., McAdams J.A., Foy B.D.، منتشرشده توسط نشر Addison-Wesley Professional در سال 2010. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

The Classic Guide to Solving Real-World Problems with Perl—Now Fully Updated for Today’s Best Idioms! For years, experienced programmers have relied on Effective Perl Programming to discover better ways to solve problems with Perl. Now, in this long-awaited second edition, three renowned Perl programmers bring together today’s best idioms, techniques, and examples: everything you need to write more powerful, fluent, expressive, and succinct code with Perl. Nearly twice the size of the first edition, Effective Perl Programming, Second Edition, offers everything from rules of thumb to avoid common pitfalls to the latest wisdom for using Perl modules. You won’t just learn the right ways to use Perl: You’ll learn why these approaches work so well. New coverage in this edition includes Reorganized and expanded material spanning twelve years of Perl evolutionEight new chapters on CPAN, databases, distributions, files and filehandles, production Perl, testing, Unicode, and warningsUpdates for Perl 5.12, the latest version of PerlSystematically updated examples reflecting today’s best idioms You’ll learn how to work with strings, numbers, lists, arrays, strictures, namespaces, regular expressions, subroutines, references, distributions, inline code, warnings, Perl::Tidy, data munging, Perl one-liners, and a whole lot more. Every technique is organized in the same Items format that helped make the first edition so convenient and popular. Effective Perl Programming 4 Cover 1 Copyright 5 Contents 8 Foreword 12 Preface 14 Introduction 22 Chapter 1 The Basics of Perl 30 Item 1. Find the documentation for Perl and its modules 30 Item 2. Enable new Perl features when you need them 33 Item 3. Enable strictures to promote better coding 35 Item 4. Understand what sigils are telling you 38 Item 5. Know your variable namespaces 40 Item 6. Know the difference between string and numeric comparisons 42 Item 7. Know which values are false and test them accordingly 44 Item 8. Understand conversions between strings and numbers 48 Item 9. Know the difference between lists and arrays 52 Item 10. Don't assign undef when you want an empty array 55 Item 11. Avoid a slice when you want an element 58 Item 12. Understand context and how it affects operations 62 Item 13. Use arrays or hashes to group data 66 Item 14. Handle big numbers with bignum 68 Chapter 2 Idiomatic Perl 72 Item 15. Use $_ for elegance and brevity 74 Item 16. Know Perl's other default arguments 77 Item 17. Know common shorthand and syntax quirks 81 Item 18. Avoid excessive punctuation 87 Item 19. Format lists for easy maintenance 89 Item 20. Use foreach, map, and grep as appropriate 91 Item 21. Know the different ways to quote strings 94 Item 22. Learn the myriad ways of sorting 98 Item 23. Make work easier with smart matching 105 Item 24. Use given-when to make a switch statement 107 Item 25. Use do {} to create inline subroutines 111 Item 26. Use List::Util and List::MoreUtils for easy list manipulation 113 Item 27. Use autodie to simplify error handling 117 Chapter 3 Regular Expressions 120 Item 28. Know the precedence of regular expression operators 120 Item 29. Use regular expression captures 124 Item 30. Use more precise whitespace character classes 131 Item 31. Use named captures to label matches 135 Item 32. Use noncapturing parentheses when you need only grouping 137 Item 33. Watch out for the match variables 138 Item 34. Avoid greed when parsimony is best 140 Item 35. Use zero-width assertions to match positions in a string 142 Item 36. Avoid using regular expressions for simple string operations 146 Item 37. Make regular expressions readable 150 Item 38. Avoid unnecessary backtracking 153 Item 39. Compile regexes only once 158 Item 40. Pre-compile regular expressions 159 Item 41. Benchmark your regular expressions 160 Item 42. Don't reinvent the regex 163 Chapter 4 Subroutines 166 Item 43. Understand the difference between my and local 166 Item 44. Avoid using @_ directly unless you have to 175 Item 45. Use wantarray to write subroutines returning lists 178 Item 46. Pass references instead of copies 181 Item 47. Use hashes to pass named parameters 185 Item 48. Use prototypes to get special argument parsing 189 Item 49. Create closures to lock in data 192 Item 50. Create new subroutines with subroutines 197 Chapter 5 Files and Filehandles 200 Item 51. Don't ignore the file test operators 200 Item 52. Always use the three-argument open 203 Item 53. Consider different ways of reading from a stream 204 Item 54. Open filehandles to and from strings 207 Item 55. Make flexible output 210 Item 56. Use File::Spec or Path::Class to work with paths 213 Item 57. Leave most of the data on disk to save memory 216 Chapter 6 References 222 Item 58. Understand references and reference syntax 222 Item 59. Compare reference types to prototypes 230 Item 60. Create arrays of arrays with references 232 Item 61. Don't confuse anonymous arrays with list literals 235 Item 62. Build C-style structs with anonymous hashes 237 Item 63. Be careful with circular data structures 239 Item 64. Use map and grep to manipulate complex data structures 242 Chapter 7 CPAN 248 Item 65. Install CPAN modules without admin privileges 249 Item 66. Carry a CPAN with you 252 Item 67. Mitigate the risk of public code 256 Item 68. Research modules before you install them 260 Item 69. Ensure that Perl can find your modules 263 Item 70. Contribute to CPAN 267 Item 71. Know the commonly used modules 271 Chapter 8 Unicode 274 Item 72. Use Unicode in your source code 275 Item 73. Tell Perl which encoding to use 278 Item 74. Specify Unicode characters by code point or name 279 Item 75. Convert octet strings to character strings 282 Item 76. Match Unicode characters and properties 286 Item 77. Work with graphemes instead of characters 290 Item 78. Be careful with Unicode in your databases 293 Chapter 9 Distributions 296 Item 79. Use Module::Build as your distribution builder 296 Item 80. Don't start distributions by hand 299 Item 81. Choose a good module name 304 Item 82. Embed your documentation with Pod 308 Item 83. Limit your distributions to the right platforms 313 Item 84. Check your Pod 316 Item 85. Inline code for other languages 319 Item 86. Use XS for low-level interfaces and speed 322 Chapter 10 Testing 328 Item 87. Use prove for flexible test runs 329 Item 88. Run tests only when they make sense 332 Item 89. Use dependency injection to avoid special test logic 335 Item 90. Don't require more than you need to use in your methods 338 Item 91. Write programs as modulinos for easy testing 341 Item 92. Mock objects and interfaces to focus tests 345 Item 93. Use SQLite to create test databases 351 Item 94. Use Test::Class for more structured testing 353 Item 95. Start testing at the beginning of your project 356 Item 96. Measure your test coverage 363 Item 97. Use CPAN Testers as your QA team 367 Item 98. Set up a continuous build system 369 Chapter 11 Warnings 378 Item 99. Enable warnings to let Perl spot suspicious code 379 Item 100. Use lexical warnings to selectively turn on or off complaints 382 Item 101. Use die to generate exceptions 385 Item 102. Use Carp to get stack traces 387 Item 103. Handle exceptions properly 391 Item 104. Track dangerous data with taint checking 393 Item 105. Start with taint warnings for legacy code 396 Chapter 12 Databases 398 Item 106. Prepare your SQL statements to reuse work and save time 398 Item 107. Use SQL placeholders for automatic value quoting 403 Item 108. Bind return columns for faster access to data 405 Item 109. Reuse database connections 407 Chapter 13 Miscellany 412 Item 110. Compile and install your own perls 412 Item 111. Use Perl::Tidy to beautify code 415 Item 112. Use Perl Critic 419 Item 113. Use Log::Log4perl to record your program's state 424 Item 114. Know when arrays are modified in a loop 431 Item 115. Don't use regular expressions for comma-separated values 433 Item 116. Use unpack to process columnar data 435 Item 117. Use pack and unpack for data munging 437 Item 118. Access the symbol table with typeglobs 444 Item 119. Initialize with BEGIN; finish with END 446 Item 120. Use Perl one-liners to create mini programs 449 Appendix A Perl Resources 456 Appendix B Map from First to Second Edition 460 Books 456 Websites 457 Blogs and Podcasts 458 Getting Help 458 Index 466 The Classic Guide to Solving Real-World Problems with Perl—Now Fully Updated for Today's Best Idioms! For years, experienced programmers have relied on Effective Perl Programming to discover better ways to solve problems with perl. Now, in this long-awaited second edition, three renowned Perl programmers bring together today's best idioms, techniques, and examples: everything you need to write more powerful, fluent, expressive, and succinct code with Perl. Nearly twice the size of the first edition, Effective Perl Programming, Second Edition, offers everything from rules of thumb to avoid common pitfalls to the latest wisdom for using Perl modules. You won't just learn the right ways to use Perl: You'll learn why these approaches work so well. New coverage in this edition includes Reorganized and expanded material spanning twelve years of Perl evolution Eight new chapters on CPAN, databases, distributions, files and filehandles, production Perl, testing, Unicode, and warnings Updates for Perl 5.12, the latest version of Perl Systematically updated examples reflecting today's best idioms You'll learn how to work with strings, numbers, lists, arrays, strictures, namespaces, regular expressions, subroutines, references, distributions, inline code, warnings, Perl::Tidy, data munging, Perl one-liners, and a whole lot more. Every technique is organized in the same Items format that helped make the first edition so convenient and popular. Joseph N. Hall, Joshua Mcadams, Brian D. Foy. Description Based On Print Version Record. Includes Bibliographical References And Index.
دانلود کتاب Effective Perl Programming: Ways to Write Better, More Idiomatic Perl (Effective Software Development Series)