Because you die if there are not two arguments on the command line there is no way that $left and $right will ever be assigned the values 'love' and 'shit'.die <<HELP unless @ARGV == 2; usage: transform.pl <word1> <word2> The program finds a way from one word to other, like this: % transform.pl love shit love-lose-lost-loot-soot-shot-shit HELP my $left = shift(@ARGV) || 'love'; my $right = shift(@ARGV) || 'shit';
You want to keep A-Z characters in a lc()ed string? What about non-ASCII lower case letters?for ($left, $right) { $_ = lc; tr/A-Za-z//cd; }
In reply to Re: Play and win the word morph game with the help of Perl :)
by jwkrahn
in thread Play and win the word morph game with the help of Perl :)
by Ieronim
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |