#!/usr/bin/perl #subs4.plx use warnings; use strict; #try using /g global to remember where I'm up to in a match my $pattern; $_ = "Three, Four, One, Two"; print ("\t\tCounting Program\n\n", $_, "\n\n"); my $correct; print "Is this sequence correct?(yes/no)\n"; $correct = ; chomp ($correct); while ($correct ne "yes"){ print "Is the first number correct?\n"; my $first = ; chomp ($first); if ($first ne "yes"){ print"What should it be?\n"; $first = ; chomp ($first); /([A-Z][a-z]+)/g; s/$1/$first/g; } print "Is the second number correct?\n"; my $second = ; chomp ($second); if ($second ne "yes"){ print"What should it be?\n"; $second = ; chomp ($second); /([A-Z][a-z]+)/g; s/$2/$second/g; } print "Is the third number correct?\n"; my $third = ; chomp ($third); if ($third ne "yes"){ print"What should it be?\n"; $third = ; chomp ($third); /([A-Z][a-z]+)/g; s/$3/$third/g; } print "Is the fourth number correct?\n"; my $fourth = ; chomp ($fourth); if ($fourth ne "yes"){ print"What should it be?\n"; $fourth = ; chomp ($fourth); /([A-Z][a-z]+)/g; s/$4/$fourth/g; } #Final print print ($_, "\n\n"); print "Is this sequence correct now?(yes/no)\n"; $correct = ; chomp ($correct); }