What you're saying here is:

1) Apply this regex to the current value of $urls - or die. Since this is not going to be a match, the die happens. When you ask for a return from a regex in scalar context you get a true or false return. You should be getting falses and thus dying.

2) If the die() wasn't there, you'd be returning nothing to the getprint() call, in which case it would try to hit that URL, which would return nothing also.

What you're likely really wanting to do is to get the HTML from the URL and then apply the regex, right? So, in that case, use get() to retrieve the HTML into a variable and then apply your regex to that. Don't forget to use the /s modifier to cross newlines. I suppose you could do it in one line without the temp variable, but it's more clear to use the variable.


In reply to Re: HTTP::Request pipe through regex by SheridanCat
in thread HTTP::Request pipe through regex by zogness

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.