The C programmer in you may rail against the inefficiency of your first solution, but this solution has you doing a pile of work that would be more efficiently handled by the computer. Get it to calculate those multiples of 6, it's better at that than you are. Factor that out, and your code will shrink.
And should the requirements ever change, you'll have much less code of your own to change. That's a much better form of effciency worth seeking.
• another intruder with the mooring in the heart of the Perl