in reply to arrange output in columns

I could give you hints and try to string you along, but for a self-professed newbie to Perl, sometimes a good example is more instructive than coming up with a sub-optimal solution of your own:

use warnings; use strict; my @fh; # Store filehandles open $fh[@fh], '<', $_ or die "Can't open `$_': $!" for <1039418/*.tx +t>; while (1) { no warnings qw/uninitialized io/; my $line; $line .= <$_> // "\n" for @fh; last if $line =~ /^\n*$/; # All files finished or blank $line =~ s/\n(?!\z)/,/g; # Delimit with commas, except for last +\n print $line; }

The challenge to you, james4545, is to take this and understand it. Break it apart. Figure out why each statement does what it does. Put it back together in a different way. Ask specific questions. Thoroughly read the documentation for each of the functions, plus perlop and perlre. Watch an episode of Futurama and then code it (this example, not Futurama) yourself from scratch without looking. Meditate on the beauty of =~ . Have a @π[1..3]. And then so shall you follow the path of a Perlmonk.

Or, by all means, copy/paste this code and move on. As much as we like to see others walk the monastic path, we monks tend to be a self-satisfied bunch.