I agree with the OP ... sub chain() is "a bit of Perl Magick" which really does deserve explanation. "Talk to us poor humans about it." Yes, it's amazing, but ... may the Bishops now educate the Candle-Boys: What does it do, why did you decide to do it that way, and how is it used in the program?