# declare string for glob my $string = ""; # slurp in file into a string $/=''; $DNA = ; # remove \n at end chomp($DNA); # replace line endings with commata $DNA =~ s/\n/,/; # surround with braces $DNA = "{$DNA}"; # $DNA should now be good for glob $string .= $DNA; # repeat for each file, don't forget to open and close