Merge remote-tracking (subtree) branch 'PracticingPerl/master'

This commit is contained in:
Dan Buch
2012-03-03 20:19:47 -05:00
41 changed files with 5186 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package base;
use strict;
use warnings;
use nginx;
sub handler {
my $r = shift();
$r->send_http_header("text/plain");
return OK if $r->header_only();
$r->print("Hello There!\n");
$r->rflush();
if (-f $r->filename or -d _) {
$r->print($r->uri, " exists!\n");
} else {
$r->print($r->uri, " does not exist!\n");
}
my $directory = '/home/me/tmp';
# '/home/me/src/LearningPerl/src/web';
my $didopen = opendir(DIR, $directory);
if ($didopen) {
while (my $file = readdir(DIR)) {
$r->print("$file\n");
}
closedir(DIR);
}
}
1;
__END__