# save the graph by saving the list of original nodes open($filehandle,"<","nodes.dat") or die("Can't open file 'nodes.dat' for writing: $!\n"); print $filehandle join("\n",@nodes);