%licenses is a Hash-of-Arrays so you'll need to use a nested loop to dereference the array.
Also, why are you not taking my advise about the proper/best way to open a filehandle?
Code:
open my $license_fh, '>', $newFile or die "failed to open '$newFile' <$!>";
foreach my $hostname ( keys %licenses ) {
foreach my $license ( @{ $licenses{ $hostname } } ) {
print {$license_fh} "$hostname $license\n";
}
}