if ( SDL::Video::MUSTLOCK($screen_surface) ) { return if ( SDL::Video::lock_surface($screen_surface) < 0 ); #required for pixel operations } #USING pack my $green = pack 'b*', '11111111000000000000000000000000'; substr( $surf32_matrix->[0][0], 0, 8 * 4, $green); #no change #substr( $surf32_matrix->[0][0], 0, 8 * 4, 0xFF000000); segfault substr( ${$surf32_matrix->[0][0]}, 0, 8 * 4, 0xFF000000); #no change #$surf32_matrix->[0][0] = $green; SEGFAULT's cannot write to memory ${$surf32_matrix->[0][0]} = $green; #no change SDL::Video::unlock_surface($screen_surface) if ( SDL::Video::MUSTLOCK($screen_surface) );