http://www.perlmonks.org?node_id=84488


in reply to Reading a Line into an Array

This works:
#!/usr/bin/perl -w use strict; open(R,"textfile"); my @F=<R>; close(R); pop @F if (@F[scalar(@F)-1] eq "\n"); print @F;
Regards