diff options
| -rw-r--r-- | challenge-207/james-smith/perl/ch-1.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/challenge-207/james-smith/perl/ch-1.pl b/challenge-207/james-smith/perl/ch-1.pl index d0e5cecd65..cc900a7700 100644 --- a/challenge-207/james-smith/perl/ch-1.pl +++ b/challenge-207/james-smith/perl/ch-1.pl @@ -10,13 +10,13 @@ my @TESTS = ( [ [qw(OMG Bye) ], '' ], ); -sub keyboard_words { grep { m{^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$}i } @_ } -sub keyboard_word { $_[0] =~ m{^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$}i } +is( "@{[ keyboard_words( @{$_->[0]} ) ]}", $_->[1] ) for @TESTS; done_testing(); -is( "@{[ keyboard_words( @{$_->[0]} ) ]}", $_->[1] ) for @TESTS; +sub keyboard_words { grep { m{^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$}i } @_ } +sub keyboard_word { $_[0] =~ m{^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$}i } ## This one looks for all keyboard words in a file... - +keyboard_word($_)&&print while<>; m{^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$}i && print while <>; |
