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

Re: I THOUGHT I'd finally understood genex

by Eily (Prior)
on Jan 09, 2018 at 14:48 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206982]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2018-07-23 14:11 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (469 votes). Check out past polls.