At 01:35 PM 8/31/00 -0500, Jonathan Scott Duff wrote:
>On Thu, Aug 31, 2000 at 07:59:31PM +0200, Dan Zetterstrom wrote:
> > Why not use the "function" we already got, tr? Something like:
> >
> > tr///l # Translate only _l_eading characters matching.
> > tr///t # Translate only _t_railing characters matching.
> >
> > With "Only leading" I mean translate from start/end until you find a
> > character not matching. Then you can do nifty things such as:
>
>Um, that would radically change the meaning of tr///. Better to use
>s/^// and s/$//.
How would you do:
# Writer insists on blank line between paragraphs, first line indented.
# Publisher insists on one paragraph/line, first word ALL CAPS.
{
local $/ = ""; #slurp paragraph at a time.
while (<INFILE>) {
s/\n//gm; # combine into one line
s/^\s//; # get rid of indent
y/a-z/A-Z/l # upcase first (English) word.
print OUTFILE;
}
}
>-Scott
>--
>Jonathan Scott Duff
>[EMAIL PROTECTED]
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Peter Scott
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Jonathan Scott Duff
- RE: Proposal: chop() dropped Eric Roode
- Re: Proposal: chop() dropped Eric Roode
- Re: Proposal: chop() dropped Nathan Torkington
- Re: Proposal: chop() dropped Dan Zetterstrom
- Re: Proposal: chop() dropped Dan Zetterstrom
- Re: Proposal: chop() dropped Jonathan Scott Duff
- Re: Proposal: chop() dropped Buddha Buck
- Re: Proposal: chop() dropped Jonathan Scott Duff
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Eric Roode
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Bart Lateur
- Re: Proposal: chop() dropped Eric Roode
- Re: Proposal: chop() dropped Tom Christiansen
- Re: Proposal: chop() dropped Bart Lateur
- Re: Proposal: chop() dropped Tom Christiansen
