in reply to Adding periord to the end of line

# replace $myline with your variable or $_ if($myline !~ /\.$/){ $myline .= ".\n"; }

Why do you put the newline back on? Are you sure you want to do that, considering you don't put it back on for the lines without a period?

If this helps, sign up! Perl Monks welcomes new monks. Post a reply if you need more help.

John J Reiser
newrisedesigns.com

Replies are listed 'Best First'.
Re: Re: (nrd) Adding periord to the end of line
by Anonymous Monk on Nov 20, 2002 at 18:41 UTC
    Thanks, John. It works smoothly. Amazingly simple. Actually, I use similar match, but different print. I know what I did wrong before: I use this instead- print $_, ".\n"; (after the match) And it only works for the first instance! Will join this group now.