Might this work as well and be further simplified?
if (/From:/) { m/^\w+:(\S+)$/ && push my @addr, Mail::Address->parse($1); $address = $addr[0]->address; $debug_text .= "Found $address at line $.\n"; }
two notes. first, I dont see mention of $string anywhere so I am assuming you meant $address. second, im not sure why you needed to modify $_, when you could just stuff the match into $1, etc. third, semantically I didnt see any reason to say "Found address" when its clear that's what this codelet is doing. :) ymmv of course. also, from perldoc perlop:
s/PATTERN/REPLACEMENT/egimosx s Treat string as single line. g Replace globally, i.e., all occurrences.
not quite sure why youre using either switch since youre matching a "From: foo@bar.com" not a "From: foo@bar.com baz bletch blah blah From: bar@brak.org".

sorry, this wasnt meant to be a round of perl golf, but there were a few simplifications i caught. :)

brother dep.

minor update:

would it be possible to just do this?

if (/^From:(\S+)$/) { push my @addr, Mail::Address->parse($1); $address = $addr[0]->address; $debug_text .= "Found $address at line $.\n"; } else { next }

--
transcending "coolness" is what makes us cool.


In reply to Re: Re: quoted-printable, and ugly code by deprecated
in thread quoted-printable, and ugly code by philth

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.