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

finddata 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: [OT] How to take only the links of files which has high prirority links using perl?
by marto (Cardinal) on Mar 16, 2017 at 09:13 UTC

    This isn't a Linux support site. You've already been told that this site is for helping people learn perl and address problems with their perl code. You seem be treating this as a code writing service which it is not. We are not here to do your job for you.

Re: [OT] How to take only the links of files which has high prirority links using perl?
by GotToBTru (Prior) on Mar 16, 2017 at 13:12 UTC

    File::Find is one way to search thru a directory structure; use it to find the file with the highest priority. Then just trace down $File::Find::dir, printing the directory contents as you go. Fancy formatting is left as an exercise for the student.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: [OT] How to take only the links of files which has high priority links using perl?
by hippo (Bishop) on Mar 16, 2017 at 09:43 UTC
      i had added my code which i had tried.
Re: [OT] How to take only the links of files which has high prirority links using perl?
by 1nickt (Canon) on Mar 16, 2017 at 11:43 UTC

    Your code captures and assigns to $max_id only the last one of the first group of digits found. I expect that's probably not what you wanted.

    perl -Mstrict -W -E 'say $1 if "hello 0 and 123 goodbye" =~ /(\d)+/;' 0
    $ perl -Mstrict -W -E 'say $1 if "hello and 123 goodbye" =~ /(\d)+/;' 3
    Perhaps you want:
    $ perl -Mstrict -W -E 'say $1 if "hello and 123 goodbye" =~ /(\d+)/;' 123

    Hope this helps!

    (Update: show suggested fix and additional failing example)

    The way forward always starts with a minimal test.
      Could you please elaborate by some loops.
        What does that mean by some English?
Re: [OT] How to take only the links of files which has high prirority links using perl?
by LanX (Saint) on Mar 16, 2017 at 09:27 UTC
    I'm curious
    • Do you notice you are getting down votes?
    • Do you wonder why?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      code which i tried is added with the question
        Do you know this doesn't answer my questions?

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!