my @cleanup = ('an', 'array', 'of', 'words'); for (my $i = 0; $i < scalar(@c1eanup); $i++) { $cleanup[$i] =~ s/oldserv001/newserv001/ig; } #### ...lots of code here if ( $something ) { my $value = 'xyzzy'; ...more code here } ...lines and lines of more code