outcast has asked for the wisdom of the Perl Monks concerning the following question:

i have having problems with the mkdir function and mason i keep getting this error:
while serving dev_jjones.stage.bizland-inc.com /webControl/securedir.c +mp (referer=, agent=Mozilla/4.76 [en] (WinNT; U)) [Sat Feb 24 17:21:04 2001] null: Error while loading '/var/mason/jjone +s/obj/webControl/securedir.cmp' at runtime: [Sat Feb 24 17:21:04 2001] null: Ambiguous call resolved as CORE::mkdi +r(), qualify as such or use & at /var/mason/jjones/obj/webControl/sec +uredir.cmp line 187. [Sat Feb 24 17:21:04 2001] null:
here is the line of code:
mkdir $dir, 0755 || BL::GenLib::MiscErr("Could not make $dir");

2001-03-04 : Edited by Corion : Added more <CODE> tags

any thoughts

Replies are listed 'Best First'.
Re: problems with mkdir and mason
by TheoPetersen (Priest) on Feb 25, 2001 at 04:10 UTC
    Apparently you've imported a module which exports a function called 'mkdir' elsewhere, or in some other way made it ambiguous. You can get rid of the error by following either suggestion. How about:
    CORE::mkdir $dir, 0755 or BL::GenLib::MiscErr("Could not make $dir");
    Also, you probably want the lower precedence or instead of || as indicated.
      works like a charm. Thanks for your help.
Re: problems with mkdir and mason
by pileswasp (Monk) on Feb 26, 2001 at 18:43 UTC
    There's a precedence problem with this code, too which might cause problems.
    You either need to use 'or' rather than '||' or to wrap the arguments to mkdir in parentheses. What you're saying here is effectively:
    mkdir $dir; 0755 || BL::GenLib::MiscErr("Could not make $dir");
    So you'll never get the error.

    I found Tom Christiansen's style guide pretty useful for correcting my precedence problems.