Someone mentioned a while back a little module implementing the io library API (read, lines, etc) on top of a regular string.