(untested)my %address; while (<DATA>) { if ( /^(To|From|Contact):.*?(<.*?>)/ ) { $address{$1} = $2; } } for my $field ( qw/To From Contact/ ) { if ( exists( $address{$field} )) { print "The $field address is $address{$field}\n"; } }
In reply to Re: How to retrieve the string after the space???
by graff
in thread How to retrieve the string after the space???
by sam_0056
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |