in reply to Help with argument to a subroutine

It is @_, definitely not $_.

You can refer to a single argument like your $header as $_[0]. If the contents you parse may be delivered in a list,

sub parse_header { for (@_) { # do this and that to $_, which is set by 'for' } }
That will work with a single argument, too. Doing it with while would fail if you did not remove elements from @_ as you dealt with them.

After Compline,
Zaxo