Sorry, I am poor in English, but is this what you want ? $title = $content; while (<FH>) { chomp; $title = $1 if ( /<title>(.+)<\/title>/i ); } print $title;
Rgds, Connie ----- Original Message ----- From: "John Pitchko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 09, 2002 12:57 AM Subject: Ternary Regex Evaluation Hello, I am trying to do some pattern matching in a ternary evaluation, but it does not seem to work. If I place the regex into a structured if statement, it evaluates fine, but not in a ternary evaluation. Here is what I have so far. my $title; ... ... ... open FH, HTML_HOME . $directory . $content or die "Cannot open file : $!"; while (<FH>) { chomp; (m/<title>(.*)<\/title>/i) ? $title = $1 : $title = $content; } print $title; Does anyone have any suggestions? TIA John Pitchko Data Services Saskatchewan Government Insurance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]