It's still not clear what you're trying to do, but you'll never get
� � �if (/^From.*\n/m) {s/^>+From://; print; }
to work on the same line because those patterns are mutually exclusive.
The patterns /^F/ and /^>+/ won't BOTH match the same line, and the
multiline mode won't help unless you've slurped the entire file into one
string. �In your one-liner, the -n option feeds $_ the file one line at a time.
Try making the test condition the same as the substitution:
� � �perl -ne 'if (/^\s*>+\s*From:/) {s/^\s*>+\s*From://; print; }' messages.txt
or you might want to try matching and printing the name(s) from the "> From:"
line, like this:
� � �perl -ne 'print "$1\n" if /^\s*>+\s*FROM:\s*(\w.*)\n?$/i' messages.txt
-- Matt Grimaldi
*******************Internet Email Confidentiality Footer*******************
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind. Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl