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

$|=1;
$base = $ARGV[0];
open(FILES,"ls -al $base |") || die ("Can not open : ".$base);
@files = <FILES>;

chdir($base);
$pwd = `pwd`;
print "$pwd"; # send currecnt directory

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