#!/usr/bin/perl
# w4.14.pl   The substitution operator.

require("mylib.pl");
@twinkle = &get_lines("twinkle.txt"); 

print ("Try one: \n");
foreach (@twinkle){
   $count++;
   s/^\s*$//;					#get rid of blank lines
   s/star/bat/i;
   s/you are./you're at./;
   }
print (@twinkle);


print ("\n\nTry two:\n");
foreach $the_line (@twinkle){
   $the_line =~ s/twinkle/blinkle/;
   }
print (@twinkle);


print ("\n\nTry three:\n");
foreach $the_line (@twinkle){
   $the_line =~ s/\b(..)inkle/\1inkus/g;
   $the_line =~ s/([^h])at/\1atus/g; 
   }
print (@twinkle);



