Challenges

1. What is the longest word in the string 'If music be the food of love play on.'  


2. Find the intersection of two arrays with the numbers 1,2,3,4,5 and 3,4,5,6,7.  


3. Given an array with positive integers. How many are even?  


4. Pass this list ab, abc, abcd, abcde, abcdef, abcdefg, abcdefgh as an anonymous array to a function that determines how many items have an even number of characters.  


5. Pass this list 12, 123, 1234, 12345, 123456, 1234567, 12345678 as an anonymous array to a function that determines how many items have an even number of digits.  


6. Given a hash where keys and values are numbers. Find all keys where key or value > 50  


7. Rolling a 6-sided dice 20 times results in the following data: 5 1 2 1 3 3 1 4 3 1 2 1 3 4 4 5 6 2 3 1. Print a frequency table where the frequency of each number is represented by an asterisk.  


8. Rewrite @list = ( grep { $_ < 10 } qw( 1 2 3 5 8 13 21 34) ); using foreach and push