So... have you tried inspecting what is contained in / returned by  $mech->content ? How is that being set?

Maybe you just need to put a backslash in front of the question mark in that regex:  /\.cfm\?member=(.*)\" class=/g because the question mark is really a regex operator, meaning "0 or 1 occurrences of the preceding character or group".

By the way, assuming that you are not setting "$/" to some special (non-default) value, the chomp is really a no-op, because your regex will never return a string that ends in a linefeed.

Update: I have to throw in a couple extra nit-picks: Since you are not changing the name of the output file inside the foreach loop, your process will work better if you open the output file only once, before the loop, and close it only once, after the loop. This won't make a big difference for small jobs, but an open/close on every iteration of a loop like that "does not scale well" when you get into large numbers of rapid iterations. Also, consistent indentation of source code is worthwhile.


In reply to Re: Pattern Matching Issues by graff
in thread Pattern Matching Issues by 80degreez

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.