in reply to Re^6: Challenge: prefix($x, $y) . suffix($x, $z) eq $x
in thread Challenge: prefix($x, $y) . suffix($x, $z) eq $x

No, Sir.

It is not prefix(hello, hello), but prefix(haughtiness, hello) etc. haughtiness, humanoid and hello have the prefix 'h' in common, and the 'ello' is provided by the words output in the suffix section. Run the prefix() sub passing it (qw(hello hello)) and you will get no return value.

So (humanoid hello, haughtiness, cello) is a valid tuple. The presence of 'hello' in the prefix section is an artifact of the implementation... er, bug ;-)

--shmem

Replies are listed 'Best First'.
Re^8: Challenge: prefix($x, $y) . suffix($x, $z) eq $x
by Limbic~Region (Chancellor) on Apr 23, 2009 at 00:51 UTC
    shmem,
    Well, the title does say prefix($x, $y) . prefix($x, $z) eq $x. In this case, $x should be 'hello'. After your explanation and examining the code that I see you are listing all words that have the same prefix which is effectively the right thing - just not displayed as expected.

    Cheers - L~R