use constant IMAGESIZE => 5; my @data = (0x0)x(IMAGESIZE*IMAGESIZE); $data[0] = 0xAA; $data[3] = 0xBB;