#!/usr/bin/perl use strict; use warnings; my ($chars, $lines, @word, $word_cnt, $mystring, $bla ); $lines = 0; while() { $chars += length($_); $lines++ ; my @word = split " ", $_; $word_cnt += @word; ($bla = $_) =~ s/\W//g; # assign the converted string of $_ to $bla $mystring .= lc($bla); # concatenate lowercase $bla to $mystring } print ("Lines: $lines\n"); print ("Words: $word_cnt\n"); print ("Characters: $chars\n"); print("Total String: $mystring \n"); __DATA__ Hey, diddle, diddle, The cat and the fiddle.