in reply to Hash of Arrays? OR Array of Hashes

They say any character combination is a valid Perl code. But it's not true. There's no sigil combination like %@. You are interested in a scalar value, so use $chaseArray[$month]{Shopify}.

Also, to extract the month from the horribly MM/DD/YYYY formatted date, you need to tell substr to use 2 characters.

Here's an example that actually does something:

#!/usr/bin/perl use strict; use warnings; use Text::CSV_XS; my $chaseCSV = 'Text::CSV_XS'->new ({ binary => 1 }); my $inFile = *DATA; my @chaseArray; while (my $row = $chaseCSV->getline($inFile)) { my @chaseList = @$row; my $month = substr $chaseList[1], 0, 2; if ($chaseList[2] =~ /(Paypal|Etsy)/) { my $company = $1; my $temp = $chaseList[3] + ($chaseArray[$month]{$company} // 0 +); $chaseArray[$month]{$company} = $temp; } } use Data::Dumper; print Dumper \@chaseArray; __DATA__ Debit,01/06/2024,Paypal paymemnt, 25.25,debit_card Debit,01/09/2024,Paypal paymemnt, 10.13,debit_card Debit,03/15/2024,Etsy paymemnt, 52.23,debit_card Debit,03/22/2024,Paypal paymemnt, 16.52,debit_card

The output:

$VAR1 = [ undef, { 'Paypal' => '35.38' }, undef, { 'Paypal' => '16.52', 'Etsy' => '52.23' } ];
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]