Can someone guide me in what 'Checks' do I need to do before I create a new folder? I know that one of the checks will be to see if the file already exists or not. What other checks could I do?
See coding for Creating new folder
Expand|Select|Wrap|Line Numbers
- use CGI;
- use strict;
- use warnings;
- my $q = new CGI;
- print $q->header(), $q->start_html();
- my $path = 'path/to/some/folder/';
- $path =~ s|\|/|g;
- my $dir = $q->param('folder');
- #vaildate the value of $dir to make sure the form has not been altered
- $path.=$dir;
- mkdir($path) or die "Unable to create folder: $!";
- mkdir("$path/hai") or die "Unable to create folder: $!";