my $out = study_substitute($_) for each (@messages); #..................................^^^?^^^^