んじゃもっと短くして・・・

open(IN,"$cart");
open(TMP,">${cart}.tmp");
print TMP grep { ! /^$del\t/ } <IN>
close IN;
close TMP;
rename(${cart}.tmp,$cart);

grep使うのは別におすすめしないけど、
判定のためだけにsplitする必要はないかと。
というか、素直にApache::Session使えばいいのにと思ったり。