[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] Regular Expression Problem



At 12:57 -0400 4/29/1999, Chris Nandor wrote:
>Here's my go at it.

At 12:32 -0400 4/29/1999, Geoffrey C Kinnel wrote:
>My not so pretty ideas pasted in below. Hope this helps.


Thanks to both of you. I don't know that he sent a copy to the list, 
but Arved covered me on this earlier today. His suggestion was:

At 13:20 -0300 4/29/1999, Arved_37@chebucto.ns.ca wrote:
>#!perl -w
>
>open(INF, "$file") or die;
>$/ = undef;
>$text = <INF>;
>close INF;
>
>$text =~ s/See\salso\s(.+)\./&new_refs($1).'.'/ge;
>print $text;
>
>sub new_refs {
>	my $oldstr = shift;
>
>	my @words = split(/;/, $oldstr);
>	my $newstr = "See also ";
>	foreach $word (@words) {
>		$newstr .= '<A HREF="/cgi-
>bin/myscript.pl?'.$word.'">'.$word.'</A>;';
>	}
>	chop $newstr;
>	$newstr;
>}
>
>__END__


This worked fine with a few adjustments. Now I've still got to figure 
out a somewhat more complex but similar problem that involves 
references out to Bible verses from some commentary. At least now 
I've got the general idea.

Thanks for your help.


Richard Gordon
--------------------
Gordon Consulting & Design
Database Design/Scripting Languages
mailto://maccgi@bellsouth.net
770.565.8267

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org