in reply to how to run system commands

hm.
The first thing that springs to mind is that you don't need the system call here, you only need the backticks, e.g.,

my $text = `cat $file`;

Do you know about perldoc? It's a great tool. It documents every single function in perl; it's a real lifesaver. Type

perldoc -f system
at a prompt and you'll get all the info you need about system, and how to get the output of a command.

Just a suggestion:
I'd probably do something like the following:

#!/usr/bin/perl -w use strict; my $file; my @files = glob("bin/*.pl"); foreach $file (@files) { open(FILE, $file) || die "Couldn't open $file: $!\n"; while(<FILE>) { chomp $_; print("$_\n"); } close(FILE); }
Use perldoc -f to look up each of the glob, open, die, while, chomp, and close functions.