seperating array elemnet by 4 character in array :  - I have an array like this
           my@array=(0x0B0x0C0x4A0x000x010x000x000x020)
         -----------------------------------------------------------------------
           I want to insert comma for each of the 4 character what i mean here is
           my@array=(0x0B,0x0C,0x4A,0x00,0x01,0x00,0x00,0x02)
        
         -----------------------------------------------------------------------
          
          #! /usr/bin/env perl
          use strict;
          use warnings;
          #reading input file by line by line.
          while (<DATA>)
          {
          #here i am extracting all hex value
          while ($_ =~ m/(0x(\d+)(?:[0-9]|[A-f])+)/gi)
   	   {
           push @hex_array, $1; #push the element
          } #end of second while loop
          } #end of first while loop
          print @hex_array;
          #first approach
          unpack("(A2)*", $hex_array);
          print {$output_fh} join("U, ", @hex_array);
        
          #second approach
          foreach my $element (@hex_array)
          {
           if (length $element eq 4)
           {
           #print @hex_array;
           print {$output_fh} join("U, ", @hex_array);
           }
          }
         --------------------------------------------------------
         but both the approaches did not work
         what would be appropriate solution?