CGI-Framework
view release on metacpan or search on metacpan
lib/CGI/Framework.pm view on Meta::CPAN
#
# Create the directories
#
foreach ($dir, $cgi_dir, $lib_dir, $sessions_dir, $templates_dir, $public_dir, $images_dir) {
print "Creating directory $_ ";
mkdir($_, 0755) || die "\n\n:Error: Failed to create $_ : $!\n\n";
print "\n";
}
print "Changing $sessions_dir mode ";
chmod(0777, $sessions_dir) || die "\n\nError: Failed to chmod $sessions_dir to 777: $!\n\n";
print "\n";
#
# Create the files
#
foreach (
[
"$templates_dir/header.html", 0644, <<"EOM"
<html>
<!-- Stub CGI created by CGI::Framework's INITIALIZENEWPROJECT command -->
lib/CGI/Framework.pm view on Meta::CPAN
],
[ "$images_dir/dotarrow.gif", 0644, "\x47\x49\x46\x38\x39\x61\x0b\x00\x08\x00\xb3\x00\x00\xff\xff\xff\xff\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...
[ "$images_dir/exclamation.gif", 0644, "\x47\x49\x46\x38\x39\x61\x0e\x00\x0e\x00\xa2\xff\x00\xff\xff\xff\xff\xe6\xb3\xff\xcc\x66\x80\x80\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x21\xff\x0b\x41\x44\x4f\x42\x45\x3a\x49\x52\x31\x2e\x30\x02...
) {
($filename, $mode, $content) = @$_;
print "Creating file $filename ";
open(FH, ">$filename") || die "\n\nError: Failed to open $filename for writing: $!\n\n";
print FH $content;
close(FH);
print "Setting permission to ", sprintf("%o", $mode), " ";
chmod($mode, $filename) || die "\n\nError: Failed to set mode on $filename to $mode: $!\n\n";
print "\n";
}
print "\n\nDONE: Your stub project is now ready in $dir\n\n";
exit;
}
############################################################################
#
# OLD COMPATABILITY SUBS START HERE
( run in 0.585 second using v1.01-cache-2.11-cpan-496ff517765 )