use strict; use IO::All; print io("file.txt")->backwards->getlines;