Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: I THOUGHT I'd finally understood genex

by Eily (Monsignor)
on Jan 09, 2018 at 14:48 UTC ( [id://1206982]=note: print w/replies, xml ) Need Help??


in reply to I THOUGHT I'd finally understood regex

$local_ip_match starts by the character m, so it will try to match something that contains an m. That's probably not what you want.

The m in m/REGEX/ is an operator, so it should not be inside the string. You can try:
$s =~ m/^192\.168\.|^10\.|^127\.0\.|^172\.16\./
or if you want to store the regex in a variable:  $local_ip_match = qr/^192\.168\.|^10\.|^127\.0\.|^172\.16\./; see qr

Who's genex?

Replies are listed 'Best First'.
Re^2: I THOUGHT I'd finally understood genex
by JEDtoo (Novice) on Jan 09, 2018 at 15:10 UTC
    1) genex are either "Young folks" or a lisdexic spelling of regex - you choose
    2) using qr fixed my problem, which WASN'T the expression so changing it was NEVER going to work.THANK YOU!!
    BTW: The list of Internet IPs is a list of real addresses trying to log into my server as root or admin or pi right now. My REAL program blocks all further traffic from those addresses, unless they are local.

      The youngest genexers® are in their late 30s now with the bulk being in their 40s and some in their 50s; only be "young folks" in Okinawa. :P

        I was born in 1952. GenX ARE young folks. Most of them probably can't even write Fortran!
Re^2: I THOUGHT I'd finally understood genex
by Laurent_R (Canon) on Jan 09, 2018 at 14:53 UTC
    Who's genex?
    JEDtoo probably means regex.

    Update: ... and, BTW, has now fixed the title of the original post.

      And I was joking ;-). The original title was edited anyway :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-23 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found