Re: Ternary Regex Evaluation

2002-07-12 Thread John Pitchko
Yes, we didn't even think about that until after someone else on this list mentioned it. We fixed it. John Pitchko Data Services Saskatchewan Government Insurance >>> "Shawn" <[EMAIL PROTECTED]> 07/12/02 04:07am >>> my $title; open (FH, HTML_HOME . $directory . $content) or die "Cannot open fil

Re: Ternary Regex Evaluation

2002-07-12 Thread Shawn
my $title; open (FH, HTML_HOME . $directory . $content) or die "Cannot open file : $!"; while (){ chomp; $title=m/(.*)<\/title>/i?$1:$content; } print $title; But, I don't see how this will work to well if this file has more than one line (unless the title tag is on the last line of the file

Re: Ternary Regex Evaluation

2002-07-08 Thread fliptop
John Pitchko wrote: > Yes that would work, but I was really curious as to why the ternary > operation does not work. In fact, none of my other ternary operations > seem to work. Is there something wrong with my syntax? probably. try putting each true/false statement inside a parenthesis.

Re: Ternary Regex Evaluation

2002-07-08 Thread John Pitchko
Yes that would work, but I was really curious as to why the ternary operation does not work. In fact, none of my other ternary operations seem to work. Is there something wrong with my syntax? Thanks, John Pitchko Data Services Saskatchewan Government Insurance >>> "Connie Chan" <[EMAIL PROT

Re: Ternary Regex Evaluation

2002-07-08 Thread Connie Chan
Sorry, I am poor in English, but is this what you want ? $title = $content; while () { chomp; $title = $1 if ( /(.+)<\/title>/i ); } print $title; Rgds, Connie - Original Message - From: "John Pitchko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 09, 2002