Now it does get called properly if you say sum(@costs.grep({$_ >= 1000})). But even though it appears to be a very simple function, it doesn't work when called this way! The problem, as far as I can tell, is that @a may look like a Seq or an Array, it's still actually an iterator. That means the first time you use it for something like, say, +@a, it is completely consumed! Then the next time you access it, there's nothing left. This is definitely not what is expected...

Update: Just realized that without "Perl 6", Ironman didn't pick up the previous post or this one. Time to edit...

And one by one, and two by two, They have sailed from the wharf since then;I have said good-bye to the last I knew, The last of the careless men.And I can’t but think that the times we had Were the best times after all,As I turn aside with a lonely glass And drink to the bar-room wall. -- Henry Lawson