perl -MTie::File -e 'tie @f, "Tie::File", shift; exit 1 unless $f[-1] =~ /^T/' /tmp/foo