#!/usr/local/bin/perl
print "Content-type: text/plain\n\n";

$|=1;
$pwd = `pwd`;
print "$pwd"; # send currecnt directory
$base = $ARGV[0];
open(FILES,"ls -alR $base |") || die ("Can not open : ".$base);
@files = <FILES>;

foreach(@files){
  print "$_";
}
close(PROC);