It looks like the "BrowserUK" solution will never call expensive_function. If $fc ever showed up in @list, that test will always yield true. If not, it will call expensive_function every time through.
The PerlMonk tr/// Advocate
Comment on Re: Re: Matching First Character of Strings Efficiently