Gossamer Forum
Home : General : Perl Programming :

Mkdir problems...

Quote Reply
Mkdir problems...
Hi..maybe someone could shed some light on a mkdir() problem I'm having. Basically, I have the following code;

Code:
mkdir("$CFG->>{admin_root_path}/Net/Whois/Raw");

...but that gives me an error;

Quote:
Not enough arguments for mkdir at (eval 8) line 83, near

I don't get this on *all* servers (about 3 in 10). I've tried changing it to;

Code:
mkdir($CFG->>{admin_root_path} . "/Net/Whois/Raw");

.. but that still gives me the same error.

Anyone got any ideas? I just can't understand why it works on some version of Perl, and not others Unsure

TIA.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mkdir problems... In reply to
1) You have failed to use error checking
2) You have a duplicate bracket ->>
Quote Reply
Re: [Paul] Mkdir problems... In reply to
>>>1) You have failed to use error checking <<<

I used it in the real thing. Just forgot to post it. It was something like;

|| die "Can't create folder. Reason: $!";

>>>2) You have a duplicate bracket ->> <<<

... but why would that cause it to work on one server, and not another? Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mkdir problems... In reply to
Anyone Unsure The whole code is;

Code:
# create folders ready for Net::Whois::Raw
chmod(0777, $CFG->{admin_root_path});
if (-e "$CFG->{admin_root_path}/Net") { chmod(0777, $CFG->{admin_root_path} . "/Net"); }
unless (-e "$CFG->{admin_root_path}/Net") { mkdir($CFG->{admin_root_path} . "/Net") or die "Can't create folder. Reason: $!"; }
if (-e "$CFG->{admin_root_path}/Net/Whois") { chmod(0777, $CFG->{admin_root_path} . "/Net/Whois"); }
unless (-e "$CFG->{admin_root_path}/Net/Whois") { mkdir($CFG->{admin_root_path} . "/Net/Whois") or die "Can't create folder. Reason: $!"; }
if (-e "$CFG->{admin_root_path}/Net/Whois/Raw") { chmod(0777, $CFG->{admin_root_path} . "/Net/Whois/Raw"); }
unless (-e "$CFG->{admin_root_path}/Net/Whois/Raw") { mkdir($CFG->{admin_root_path} . "/Net/Whois/Raw") or die "Can't create folder. Reason: $!"; }
chmod(0755, $CFG->{admin_root_path});

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!