The FileHandle Module

use FileHandle;

$fh = new FileHandle "< nodes.lis"; 
@nodes = <$fh>;
undef $fh; # automatically closes the file