For every function, I presented the syntax forms and a brief description. This was necessary to help you better understand how to use the topics. If you want a complete description of these functions, you should go for additional information to the Perl official site by following the link perldoc.
If you take your time to skim through the Table of Contents of this eBook, you’ll see what you should expect to find here. From using these functions with simple lists, arrays and hashes or with more complex data structures as arrays of arrays, arrays of hashes, hashes of arrays or hashes of hashes, you’ll find here a lot of commented examples to help you find a quick solution to your problem.
The examples included in this eBook are not only about the list data functions, but also show you how to use these functions together with the operators, special variables, statements, regular expressions and with simple or complex data structures. In the same time are provided interesting examples about how to use these functions with @_, @$_, %{}, ||, &&, =>, @{}, [], $_.
Complete solutions are provided for almost all the examples. Each example can be tested, modified and run individually. Every example shows you a way to resolve a specific problem, allowing you to find out a quick answer to your problem or question.
Of course you can continue searching through the forums to find the answer of your question but in this case you need to choose, test and interpret yourself the information provided in the forums.
| 1. | Copyright |
| 2. | Introduction |
| 2.1. | How to run the examples included in this eBook |
| 2.1.1. | How to run the script in Windows |
| 2.1.2. | How to run the script in Linux |
| | |
| 3. | Functions for list data |
| | |
| 3.1. | The grep function |
| 3.1.1. | The syntax forms |
| 3.1.2. | How to use grep as a filter |
| 3.1.3. | How to use grep as a counter |
| 3.1.4. | How to use grep as a finder |
| 3.1.5. | How to use grep with a list |
| 3.1.6. | How to use grep with an array |
| 3.1.7. | How to use grep to return true or false |
| 3.1.8. | How to use grep and defined |
| 3.1.9. | How to use grep with regex |
| 3.1.10. | grep versus foreach |
| 3.1.11. | How to get the number of array elements that match a pattern |
| 3.1.12. | How to look for a string that contains meta-characters |
| 3.1.13. | How to toggle through the elements of an array |
| 3.1.14. | How to extract the list elements that occur a given number of times |
| 3.1.15. | How to use grep to delete elements from an array |
| 3.1.16. | How to find the intersection/difference of two arrays |
| 3.1.17. | How to use grep with an AoA (Array of Arrays) |
| 3.1.18. | How to use grep with an AoH (Array of Hashes) |
| 3.1.19. | How to use grep with an HoA (Hash of Arrays) |
| 3.1.20. | How to use grep with an HoH (Hash of Hashes) |
| | |
| 3.2. | The join function |
| 3.2.1. | The syntax forms |
| 3.2.2. | How to concatenate the elements of an array into a string |
| 3.2.3. | How to change the words delimiter within a string |
| 3.2.4. | How to use join with an AoA (Array of Arrays) |
| 3.2.4.1. | How to join into a string the elements of a particular sub-array |
| 3.2.4.2. | How to join into a string the elements of a matrix column |
| 3.2.4.3. | Turn each sub-array into a string and concatenate all these strings |
| 3.2.5. | How to extract the keys from an AoH (Array of Hashes) |
| 3.2.6. | How to print a HoA (Hash of Arrays) |
| | |
| 3.3. | The map function |
| 3.3.1. | The syntax forms |
| 3.3.2. | map versus foreach |
| 3.3.3. | map versus grep |
| 3.3.4. | How to get a list with the squares of the first 10 positive numbers |
| 3.3.5. | How to apply a function to a list |
| 3.3.6. | A map, grep and sort example |
| 3.3.7. | How to use map with regex |
| 3.3.8. | How to use map to read data from a csv file |
| 3.3.9. | How to make a hash out of a delimited string |
| 3.3.10. | How to find the union of two arrays |
| 3.3.11. | How to use map with an AoA (Array of Arrays) |
| 3.3.12. | How to use map with an AoH (Array of Hashes) |
| 3.3.13. | How to use map with an HoA (Hash of Arrays) |
| 3.3.14. | How to use map with an HoH (Hash of Hashes) |
| | |
| 3.4. | The qw/STRING/ function |
| 3.4.1. | The syntax forms |
| 3.4.2. | How to use qw to initialized an array |
| 3.4.3. | How to use qw to populate a hash |
| 3.4.4. | How to use qw with a list of predefined strings |
| | |
| 3.5. | The reverse function |
| 3.5.1. | The syntax forms |
| 3.5.2. | A few examples |
| 3.5.3. | How to sort an array in a reversed order |
| 3.5.4. | How to use reverse to invert a hash |
| 3.5.5. | How to get a sentence with the words in an inverted order |
| 3.5.6. | How to reverse the columns of a matrix hold in an array |
| | |
| 3.6. | The sort function |
| 3.6.1. | The syntax forms |
| 3.6.2. | How to sort a hash by keys |
| 3.6.3. | How to sort a hash by values |
| 3.6.4. | How to sort the elements of a hash by the length of keys |
| 3.6.5. | How to sort the elements of a hash by the length of values |
| 3.6.6. | How to sort an AoA (Array of Arrays) |
| 3.6.7. | How to sort an AoH (Array of Hashes) |
| 3.6.8. | How to sort an HoA (Hash of Arrays) |
| 3.6.9. | How to sort an HoH (Hash of Hashes) |
| 3.6.10. | How to sort using the Schwartzian transform |
| 3.6.11. | How to sort a matrix by multiple columns |
| 3.6.12. | How to sort a list of IP addresses |
| | |
| 3.7. | The unpack function |
| 3.7.1. | The syntax forms |
| 3.7.2. | The 'a' template |
| 3.7.3. | The 'A' template |
| 3.7.4. | The 'b' and 'B' templates |
| 3.7.5. | The 'c' and 'C' templates |
| 3.7.6. | The 'd' template |
| 3.7.7. | The 'f' template |
| 3.7.8. | The 'h' and 'H' templates |
| 3.7.9. | The 'i' and 'I' templates |
| 3.7.10. | The 'l' and 'L' templates |
| 3.7.11. | The 'n' and 'N' templates |
| 3.7.12. | The 's' and 'S' templates |
| 3.7.13. | The 'U' template |
| 3.7.14. | The 'v' and 'V' templates |
| 3.7.15. | The 'x' and 'X' templates |
| 3.7.16. | How to reverse the bits in each character of a string |
| 3.7.17. | How to get the ASCII values of a string characters |
| 3.7.18. | How to use unpack with files having fixed-length records |
| 3.7.18.1. | How to read a text file |
| 3.7.18.2. | How to use unpack and pack to create a binary file from a text file |
| 3.7.18.3. | How to use unpack to read a binary file |
| 3.7.19. | Short dictionary |
If you consider that this book is valuable or you have some suggestions to improve its content, please send me some feedback through my contact page.
30-Day, 100% unconditional money-back guarantee
If for any reason you don’t think this eBook is helpful to you in any way, I offer an unconditional, no-questions-asked, 30-Day 100% refund. You can’t lose on this deal.