Tutorials Point


  Perl Home

  PERL Functions

© 2011 TutorialsPoint.COM


  Home     References     About TP     Advertising  

PERL mkdir Function



Syntax

mkdir EXPR,MODE


Definition and Usage

Makes a directory with the name and path EXPR using the mode specified by MODE, which should be supplied as an octal value for clarity.

Return Value

  • 0 on failure

  • 1 on success

Example

Try out following example:

#!/usr/bin/perl -w

$dirname ="/tmp/testdir";

mkdir $dirname, 0755;

It will produce following results in /tmp directory:

drwxr-xr-x  2 root   root    4096 Mar 19 11:55 testdir


Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names