Reads an entire input file into an array. : file read « File « Perl
- Perl
- File
- file read
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);
Related examples in the same category