2025 Advent of Code Day 4 Part 1

Perl. Developed and tested with Perl 5.42.0. use v5 .42 ; my @grid ; open DATA, q/data/ ; while ( <DATA> ){ chomp ; push @grid , [ split // , $_ ]; } my $forklift_accessible = 0 ; for my $i ( 0 .. @grid - 1 ){ my $row = $grid [ $i ]; for my $j ( 0 .. @ { $row } - 1 ){ if ( $row -> [ $j ] eq q/@/ ){ $forklift_accessible += is_accessible( $i , $j , \ @grid ); } } } say $forklift_accessible ; sub…