Ramprasad A Padmanabhan wrote: > > do this > > $header=~s/\r+//g; > > and then try parsing it > Also > You need not use /\nFrom:\s*(.*)/m > You can use /^From:\s*(.*)$/m > ( 'm' treats every new line a full string individually)
/m causes the ^ and $ anchors to match the beginning and end of a line in a string instead of the beginning and end of the string. $ perl -le' $_ = "one this\ntwo that\nthree the other\n"; print "1 >$1<" if /\ntwo\s*(.*)/; print "2 >$1<" if /^two\s*(.*)/; print "3 >$1<" if /^two\s*(.*)/m; ' 1 >that< 3 >that< John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]