LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2007, 01:21 AM   #1
indu.a
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Rep: Reputation: 0
create a folder/file within a folder using perl


Hello,

I am new to scripting in Perl.

How do I create a folder/file within a folder using Perl.

I created a folder using :

print `mkdir dir1`; # creates a directory names dir1

Now I need to create a folder in dir1, how do I do it.

Thank You !
 
Old 03-07-2007, 02:43 AM   #2
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
Code:
#! /opt/third-party/bin/perl

mkdir("dir1/n1") || die "Unable to create directory <$!>\n";

exit 0
 
Old 03-07-2007, 10:09 PM   #3
indu.a
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Smile

Thank you very much !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i can't create folder or file by root user. Linux For Ever Red Hat 7 01-19-2007 02:34 PM
How to create cron job to empty mbox folder/file sjmo2 Linux - General 4 03-23-2006 02:39 PM
perl script help required to create users and changing the owner to pericular folder sridhar11 Programming 2 10-25-2005 02:16 PM
can copy-paste or create new file/folder, if boot from live cd gjo Linux - Distributions 3 09-17-2004 08:43 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration