#!/usr/bin/perl
use strict;
use CGI;
my $query = new CGI;
my $filter = "*.pl *.txt";
print "Content-type: text/plain";
my $lsoutput = `ls -lt $filter`;
print "\n$lsoutput";
I have included use strict; and a variable called $filter which, in the example provided, returns the output for the following command ls -lt *.pl *.txt