alot of the monks already suggested good ways to do this.
but, if you're still wondering what's going on in your code,
the shift operator removes elements from @name.
that means the second time through the loop, @name is empty. and nothing is printed.
Not necessarily... since Bongo didn't mention how the
arrays get filled in the first place, @names could have
a lot more elements than @headings. But it may be worthwhile
for Bongo to check that this is the case.