in reply to variables from STDIN
I think that the "rules" are more complex than you have specified.
This code is simple, but I think it illustrates this "y" difficulty.
I guess at the end of the day, I don't understand the complete problem.#!/usr/bin/perl -w use strict; my @array = ("BOB", "Sheila", "Very", "by", "berry", "beyond"); foreach my $word (@array) { my $original = $word; $word = uc $word; $word =~ s/V/C/g; $word =~ s/[AEIOUY]/V/g; $word =~ s/[^V]/C/g; printf "%-10s %s\n", $original, $word; } __END__ BOB CVC Sheila CCVVCV Very CVCV by CV berry CVCCV beyond CVVVCC #No!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: variables from STDIN
by tangent (Parson) on Feb 22, 2012 at 17:30 UTC |