in reply to [OT] How to take only the links of files which has high prirority links using perl?

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.
  • Comment on Re: [OT] How to take only the links of files which has high prirority links using perl?
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: [OT] How to take only the links of files which has high prirority links using perl?
by finddata (Sexton) on Mar 16, 2017 at 11:51 UTC
    Could you please elaborate by some loops.
      What does that mean by some English?