a perl question

Richard Kuhns rjk at sawmill.uucp
Fri Nov 10 08:29:36 AEST 1989


I'm not entirely sure that this is the newsgroup I should use, but
I've seen a number of perl questions/answers and I don't know of a
better newgroup (until comp.lang.perl comes along).

My question:  I'd dearly love to have a filter, written in perl (the
rest of the code for this project is in perl, and I'll post it when I
get it working), which would turn the string `B^HBO^HOL^HLD^HD' into
`$bold_startBOLD$bold_end', where $bold_start and $bold_end are
predefined character strings.  I have a filter that does this already
written in C, but it seems to me I should be able to do it easier in
perl (using regular expressions?), but I can't come up with a good way
to do it.  /(.)\010$1/ recognizes one element of such a string (always
the first).  s/(.)\010$1/$1/g specifically does NOT work (it only
changes the first occurence).

Thanks (in advance, of course).

Rich Kuhns
newton.physics.purdue.edu!sawmill!rjk



More information about the Comp.unix.questions mailing list