Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

how to iterate directory

by rajand
on Jun 22, 2021 at 18:09 UTC ( #11134181=perlquestion: print w/replies, xml ) Need Help??

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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: how to iterate directory
by stevieb (Canon) on Jun 22, 2021 at 18:36 UTC

    Please show us the code you've tried that doesn't work. Also explain exactly what you want to have happen, and what problems your current broken code is having.

Re: how to iterate directory
by Fletch (Chancellor) on Jun 22, 2021 at 21:34 UTC

    What have you tried? What didn't work? What about opendir / readdir / closedir has confused you? Are you looking to expand wildcards and don't get glob? Have you tried installing something like Path::Tiny or File::Find::Rule from CPAN?

    As asked no one is going to be able to give you more than vague pointers.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: how to iterate directory
by kcott (Bishop) on Jun 23, 2021 at 05:54 UTC
Re: how to iterate directory
by tybalt89 (Prior) on Jun 22, 2021 at 23:49 UTC

    Here's a guess...

    system "cut -opts $_/file >$_/newfile" for qw( d1 d2 d3 d4 d5 );

    Of course, change "-opts" to your actual "cut" flags and "file" and "newfile" to your desired file names.

    If this is not what you are looking for, a better description of your problem is needed...

Re: how to iterate directory
by 1nickt (Abbot) on Jun 23, 2021 at 08:37 UTC

    Possibly the laziest of all lazy questions.


    The way forward always starts with a minimal test.
Re: how to iterate directory
by Anonymous Monk on Jun 23, 2021 at 13:16 UTC
    The people who are saying these things to you are not being rude nor unkind. If you asked this one-sentence question of a co-worker, who was therefore probably familiar with you and with what you're doing, he or she could "look over your shoulder" and probably help you. But when you ask a question on an Internet forum like this one, your question must be self-contained and "answerable." Please do carefully read the "effectively" link and try again.
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2021-12-06 22:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (33 votes). Check out past polls.

    Notices?