Gossamer Forum
Home : General : Perl Programming :

Can anyone spot the problem?

Quote Reply
Can anyone spot the problem?
Can anyone see the problem with this code?

It works perfectly except for one directory which isn't created admin/templates/admin

Code:
sub make_dirs {
#----------------------------------------------------------
# Make all the necessary directories.

my @errors;

my $dirs = { 1 => ['admin',0777],
2 => ['Config',0777],
3 => ['Library',0777],
4 => ['admin/templates',0777],
5 => ['admin/templates/user',0777],
6 => ['admin/templates/staff',0777],
7 => ['admin/templates/admin',0777]
};

for my $dir (keys %$dirs) {
mkdir (${$dirs->{$dir}}[0], ${$dirs->{$dir}}[1]) or push @errors, "Could not make " . ${$dirs->{$dir}}[0] . ": $!";
}

return;

}

Thanks. Btw....@errors prints "Could not make admin/templates/admin: No such file or directory"

Last edited by:

RedRum: Jan 10, 2002, 8:38 AM
Quote Reply
Re: [RedRum] Can anyone spot the problem? In reply to
Why does perl have to be so weird sometimes :(

I entered full paths and re-tried and got the same error so changed the paths back and it works now Unsure

Last edited by:

RedRum: Jan 10, 2002, 8:42 AM
Quote Reply
Re: [RedRum] Can anyone spot the problem? In reply to
Is this an auto install for your HelpDesk?
I like the code there.
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Can anyone spot the problem? In reply to
Yup...working on it as we speak.

Hehe you should see how Im extracting all the files :)

Everything is in one large file like GT does with their SQL products but it isn't a tar file Crazy

Last edited by:

RedRum: Jan 10, 2002, 9:48 AM