number of fields in a text file as a variable - perl

I am looking for perl code to get following o/p. If a line has more than 7 fields then value in field 7 onwards is BHA_GRP1, BHA_GRP2, BHA_GRP3, BHA_GRP4 etc.
Here is example of what I am trying to achieve.

INPUT File:
VAH NIC_TYPE CONFIG SIZE_GB PILO KOM BHA_GRP1 BHA_GRP2 BHA_GRP3......

2 NIC6 cont 34 y n shal_orgrp shal
4 NIC5 signa 52 n y shal_orgrp1 new_shal test
3 TIC signa 8 n y shal_orgrp2

OUTPUT:
For line 2 -- $BHA_GRP1 = shal_orgrp, $BHA_GRP2= shal
line3 -- $BHA_GRP1= shal_orgrp1, $BHA_GRP2= new_shal, $BHA_GRP3=test
line4-- $BHA_GRP1= shal_orgrp2

Hi,

Test next 'Perl' script:

$ cat infile
VAH NIC_TYPE CONFIG SIZE_GB PILO KOM BHA_GRP1 BHA_GRP2 BHA_GRP3......

2 NIC6 cont 34 y n shal_orgrp shal
4 NIC5 signa 52 n y shal_orgrp1 new_shal test
3 TIC signa 8 n y shal_orgrp2
$ cat script.pl
use strict;
use warnings;
use autodie;

@ARGV == 1 or die "Usage: perl $0 input-file\n";
open my $fh, "<", $ARGV[0];
my (@grp, @sha);

while ( <$fh> ) {
    chomp;
    if ( $. == 1 ) {
        @grp = split;
        @grp = splice @grp, 6;
        next;
    }
    next if /^\s*$/;
    @sha = split;
    @sha = splice @sha, 6;
    print +(join ", ", map { "\$" . ($grp[$_] || "???") . " = " . $sha[$_] } 0 .. $#sha ), "\n";
}

close $fh or warn "Error: Cannot close $ARGV[0]\n";
$ perl script.pl infile
$BHA_GRP1 = shal_orgrp, $BHA_GRP2 = shal
$BHA_GRP1 = shal_orgrp1, $BHA_GRP2 = new_shal, $BHA_GRP3...... = test
$BHA_GRP1 = shal_orgrp2

Regards,
Birei