#!/usr/bin/perl -w use strict; my @array = ('test.pl', 'b64.pl'); my @output; foreach (@array) { push @output, `cat $_`; } print @output;