http://www.perlmonks.org?node_id=1030289


in reply to Re: How can one get all possible combinations of elements of different arrays using File::Glob(bsd_glob)?
in thread How can one get all possible combinations of elements of different arrays using File::Glob(bsd_glob)?

# slurp in file into a string $/=''; $DNA = <FILE>; # remove \n at end chomp($DNA);

You have set $/ to paragraph mode so it will not "slurp in file", just the first paragraph of the file.    Also the value of $/ will effect what chomp removes (hint: paragraph mode removes more than just a single \n character).



# replace line endings with commata $DNA =~ s/\n/,/;

That replaces a single newline.    If you want to replace ALL newlines then:

# replace newlines with commas $DNA =~ s/\n/,/g;

Or perhaps:

# replace newlines with commas $DNA =~ tr/\n/,/;