Perl Snippets
Perl snippets that would help in solving quick and easy problems
Creating arrays and hashes in perl

Creating arrays and hashes in perl I’m sure for those users looking for dynamically storing their information they will most likely rely at some point on arrays. Here are some quick snippets on how to create arrays and associative arrays in perl (hashes). Creating an array in perl Arrays are preceded by the symbol “@”,
How to strip spaces out of a string in perl

How to strip spaces out of a string in perl You have a variable string that may have blank spaces at the end of the string or at the start of the string and you need to remove these spaces so that you can make use properly of the value of that variable. Scenario
1 2 |
//You want to strip spaces from the left side and right side of the bellow string and obtain "username" $val_string= ' username '; |