Open-heart surgery on Perl optrees