/ Published in: Perl
Load a text file into an array. Remove all CR/LF.
Expand |
Embed | Plain Text
#------------------------------------------------------------------------------ # sub load_file_in_array(): # Load a text file into an array. Remove all CR/LF. # sub load_file_in_array { (my $a_file) = @_; my @the_lines = (); unless ("$a_file" eq "") { # load the test case file { die "ERROR: $PROGNAME: Can't open '$a_file': $!"; } @the_lines = <FILE>; close FILE; } return @the_lines; }
You need to login to post a comment.
