/ Published in: Perl
Load a text file into an array. Remove all CR/LF.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#------------------------------------------------------------------------------ # 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 { } @the_lines = <FILE>; close FILE; } }