Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

How to send subdirectories name through parameters to parent direcory

by Anjali1 (Initiate)
on Apr 14, 2016 at 17:52 UTC ( [id://1160433]=perlquestion: print w/replies, xml ) Need Help??

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

Hello, I got a different scenario. I have directory as /var/user. In that i have sub directories as /var/user/10/202/31/40 /var/user/10/202/31/41 /var/user/11/203/32/42 /var/user/12/201/31/43 Now, I want to remove 40, 41, 42, 43 directories which are last. Till /var/user its same. After that i would like to send sub directories path through notepad as a parameter. Like.. I would like to give sub directories information in notepad. Like below subdirectory.txt 10/202/31/40 10/202/31/41 11/203/32/42 Now, i have created variable $parent_directory = '/var/usr/$subdirectory.txt. Can some one please help me How to start this coding in proper manner. I got confused and don't know where to start.. Please help me out.
  • Comment on How to send subdirectories name through parameters to parent direcory

Replies are listed 'Best First'.
Re: How to send subdirectories name through parameters to parent direcory
by GrandFather (Saint) on Apr 15, 2016 at 00:16 UTC
    1. Start by looking at your problem description and decide if it is a clear and concise as it can possibly be.
    2. Write a list of the tasks that need to be done to solve the problem.
    3. Translate the list of tasks into a sketch of the code. That needn't be much more than copying the list into the code as comments.
    4. Flesh out the tasks one at a time. For each task test that it is doing what you expect.
    5. Test that the overall code works.
    6. Profit

    You should apply the same critical analysis to your post here. Does it look the way you wrote it? (You can edit it you know.) Is it clear to anyone reading it? Can you improve it in any way? See I know what I mean. Why don't you?.

    Premature optimization is the root of all job security

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1160433]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found