in reply to "not enough arguments" with 'mkdir' command

Not enough clues have been given, but I can guess that it didn't use the mask you thought you specified because you used the wrong format. e.g., 777 instead of 0777. As to why mkdir complains about the number of arguments ... are you sure that's a perl error?

Replies are listed 'Best First'.
Re: Re: "not enough arguments" with 'mkdir' command
by jsprat (Curate) on Dec 09, 2003 at 00:51 UTC
    mask was required in 5.005_03. It became an optional argument for mkdir in 5.6, iirc.

Re: Re: "not enough arguments" with 'mkdir' command
by sauoq (Abbot) on Dec 09, 2003 at 00:49 UTC
    are you sure that's a perl error?

    The mask argument is optional and defaults to 0777. He should be able to get by with a single argument. I agree with you that he didn't provide enough clues.

    Update: Oops, jsprat++ is completely correct. The mask is not optional in 5.005. Sorry for any confusion.

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: Re: "not enough arguments" with 'mkdir' command
by nysus (Parson) on Dec 09, 2003 at 00:48 UTC
    I tried both 777 and 0777. But I get the error when I don't supply the mask. Here's the entire error message:
    Not enough arguments for mkdir at ./test_file.pl line 3, near "'ding'; +" Execution of ./test_file.pl aborted due to compilation errors.
    The entire program is just one line.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks

      The entire program is just one line.

      Can you show us that one line then?

      Does

      perl -e "mkdir q(foobar), 0777"
      work for you?

      Update: Changed to include umask as jsprat's comment is correct.

      -sauoq
      "My two cents aren't worth a dime.";
      
        Yeah, here's the line:
        mkdir 'ding';
        I also get an error with your line:
        syntax error at ./test_file.pl line 3, near "perl -e " Execution of ./test_file.pl aborted due to compilation errors.

        $PM = "Perl Monk's";
        $MCF = "Most Clueless Friar Abbot Bishop Pontiff";
        $nysus = $PM . $MCF;
        Click here if you love Perl Monks