Mega Code Archive

 
Categories / Perl / File
 

Reads an entire input file into an array

#!/usr/local/bin/perl  unless (open(MYFILE, "file1")) {     die ("cannot open input file file1\n");  }  @input = <MYFILE>;  print (@input);