# add the new item to the list: open TMP, "> $tmp"; print TMP @items; print TMP $new_item; close TMP; open TMP, "< $tmp"; @items = ; close TMP;