Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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 ( [id://1184866]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found