Join and Split:

if ($Type){ ( $Type, $Type2) = split( /#/, $Type ); }
if ($Vertical){ ( $Vertical, $Vertical2, $Vertical3) = split( /#/, $Vertical ); }

if($I{'Vertical3'}) { push(@Vertical, "$I{'Vertical3'}"); }
$Vertical = join('#',@Vertical);