in reply to Re^3: Optimizing a Text Canvas: An inner loop and a cloner
in thread Optimizing a Text Canvas: An inner loop and a cloner

(In response to chatterbox questions...)

To get the data back out from the bitfield, shift back to the right and use a logical bitwise AND to extract the relevant bits:

$as_bg = $attribs & 255; $as_fg = $attribs >> 8 & 255; $as_u = $attribs >> 16 & 1; $as_bold = $attribs >> 17 & 1; $as_blink = $attrib >> 18 & 1;

update: Corrected && to &.