http://qs321.pair.com?node_id=11134181

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 (Bishop) 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 (Archbishop) on Jun 23, 2021 at 05:54 UTC
Re: how to iterate directory
by tybalt89 (Monsignor) 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 (Canon) 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.