Sorry if this is double posted... How about something like this? NOT TESTED! Also assuming your input will be the same as quoted but without leading //'s
while($line = <STDIN>) { chomp($line); if ($line =~ /email /i) { $line =~ s/^\s+//g; #Strip any leading white space. $line =~ s/^email //g; #Replace starting email[SPACE] with nothing. $EMAIL = $line; #Assign remaining stuff in line to $EMAIL var #$EMAIL .= $line\n; #If you expect more than one line with same format in the input, unremark and use this line instead. } } Now $EMAIL should contain [EMAIL PROTECTED] or list of emails pulled from input. Bill Akins, CNE Sr. OSA Emory Healthcare (404) 712-2879 - Office 12674 - PIC [EMAIL PROTECTED] >>> lz <[EMAIL PROTECTED]> 05/24/02 09:27 AM >>> Hi guys, I am reading an email coming to my perl script. I need to parse incoming document and select a specific field I need. WHILE(<STDIN>) { // how do I search for a field, called e.g. // email [EMAIL PROTECTED] // and assign email to a variable? } Thanks a lot! __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CONFIDENTIALITY NOTICE: This message may contain legally confidential and privileged information and is intended only for the named recipient(s). No one else is authorized to read, disseminate, distribute, copy, or otherwise disclose the contents of this message. If you have received this message in error, please notify the sender immediately by e-mail or telephone and delete the message in its entirety. Thank you. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <<<<GWIASIG 0.06c>>>> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]