mkdir("hohofiles", 0777) || print $!;
This will make a directory named hohofiles in the current directory.
-We called Perl's built-in mkdir function.
-We enclosed the name we'd like our directory to have in quotation marks. This could have also included the path to our new directory.
-We set permissions to 0777. (Most likely your directory will have permissions of 755 due to a umask of 22.)
-We included two vertical bars or pipes, which mean "or".
-We said to print any error we might receive. The errors are contained in the built-in variable $!
-Summary: make our directory or print errors.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
mkdir("hohofiles", 0777) || print $!;
mkdir("hohofiles/jiji", 0777) || print $!;
print " -Done";
exit;
This will make a directory named hohofiles in the current directory.
-We called Perl's built-in mkdir function.
-We enclosed the name we'd like our directory to have in quotation marks. This could have also included the path to our new directory.
-We set permissions to 0777. (Most likely your directory will have permissions of 755 due to a umask of 22.)
-We included two vertical bars or pipes, which mean "or".
-We said to print any error we might receive. The errors are contained in the built-in variable $!
-Summary: make our directory or print errors.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
mkdir("hohofiles", 0777) || print $!;
mkdir("hohofiles/jiji", 0777) || print $!;
print " -Done";
exit;
No comments:
Post a Comment