iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Pass the Javascript, please...
    143,049

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Making a Directory Using mkdir in Perl

    Making a Directory Using mkdir in Perl



    mkdir("hohofiles", 0777) || print $!;

    This will make a directory named hohofiles in the current directory.


    -We called Perl's built-in mkdir function.
    -We enclosed the name we'd like our directory to have in quotation marks. This could have also included the path to our new directory.
    -We set permissions to 0777. (Most likely your directory will have permissions of 755 due to a umask of 22.)
    -We included two vertical bars or pipes, which mean "or".
    -We said to print any error we might receive. The errors are contained in the built-in variable $!

    -Summary: make our directory or print errors.




    Copy and Paste Perl Code:

    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    mkdir("hohofiles", 0777) || print $!;
    mkdir("hohofiles/jiji", 0777) || print $!;

    print " -Done";

    exit;



    Resources:
    Use the Perl PRINT FUNCTION
    Use chmod in Perl



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Create an Array of Specific Numbers in Perl
    Next Article: Use chmod in Perl





    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    New Perspectives on Crea...New Perspectives on Creating Web Pag...

    Patrick Carey

    New $69.26

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    CSSCSS

    Eric Meyer

    New $29.69


    Of Interest:
  • INCREMENT and DECREMENT a Variable in Perl
  • Matching at the Beginning and End
  • Splitting an ARRAY in Perl
  • Create or Put Items into an Array in Perl
  • Setting a Cookie using Javascript
  • Javascript Redirect
  • Javascript Push - Use Push on an Array in Javascript
  • Focus a Window with self.focus in Javascript
  • HTML Tables
  • Make Text Bold Using HTML
  • HTML Color Codes
  • HTML Codes

  • More Articles:
  • Redirect to a Different URL in Perl
  • To Sort an Array in Perl
  • Getting Server Time in Perl
  • onClick Javascript
  • Call your Function in Javascript
  • Select All or Highlight Text Fields and Textareas Using Javascript
  • Substitute in Javascript Using replace Method
  • Use onLoad to Call More than One Function with Javascript
  • HTML Tables
  • HTML Space
  • HTML Image
  • Make Text Bold Using HTML

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    439,815
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:16 EDT