Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl 
    use 5.010_000;
    ...
    Hey, diddle, diddle,
    The cat and the fiddle,
    The cow jumped over the moon.
    
  2. or download this
    Number of chars: 75
    Number of words: 14
    Number of lines: 3
    heydiddlediddlethecatandthefiddlethecowjumpedoverthemoon
    
  3. or download this
    push @words, map { lc } # change to lower case
        map { tr/'//d; $_ } # remove apostrophes
        split /[\s.,?!"]+/, # split on space and punctuation
        $line;
    
  4. or download this
    use List::Util;