in reply to Re: if/else loop prints extra values
in thread if/else loop prints extra values

... issues with your regex.

($domain) = $url =~ m|www.([A-Z a-z 0-9]+.{3}).|x;

kcott: Hi Ken! The discussion stemming from Re: Perl prints only last line of array indicates the regex in question is working just fine for myfrndjk although I share your puzzlement as to how it could. Anyhoo... ++ for a valiant explanatory effort.

Replies are listed 'Best First'.
Re^3: if/else loop prints extra values
by kcott (Archbishop) on Jul 04, 2014 at 18:20 UTC

    G'day AnomalousMonk,

    [Sorry for the late reply. As you may have noticed, I haven't been here much in recent weeks. Various other things are taking up my time at the moment — none of which are any cause for concern :-)]

    I found it curious that mangling 5 valid URLs would result in 3 different valid URLs.

    I found it curiouser that those mangled URLs all turned out to be shopping sites.

    I found it curiousest that some of those names sounded familiar: perhaps from "Nodes To Consider".

    -- Ken