Yes, because 'world' is there twice, it loops infinitely.
You need to understand what a hash (associative array) is, to really see what is going on.
For this example it's functioning like a lookup table.
$_{KEY} = VALUE
$_{'peace'}='world'
$_{'walks'}='peace'
$_{'away?'}='walks'
$_{'world'}='away?'
$_{''}='world'
while $_ = $_{$_}; # loop while I get a VALUE; assign KEY=VALUE after each iteration
KEY = '' VALUE = 'world'
KEY = 'world' VALUE = 'away?'
KEY = 'away?' VALUE = 'walks'
KEY = 'walks' VALUE = 'peace'
KEY = 'peace' VALUE = 'world'
KEY = 'world' VALUE = 'away?' #infinite looping begins
.
.
.