On Wed, 09 Aug 2000, Ed Mills wrote:
> Here is the argument-
>
> Perl has (had?) chomp(). It removes \n at the end of a line. That's
> something we often need to do. We ALSO often need to ADD \n to the end of a
> line. This usually looks something like:
>
> print "$kitty\n";
Chomp removes one or more line separators from the end.
>
> Hence my println() suggestion. Maybe instead it should be:
>
> unchomp;
> print;
>
> Where unchomp ADDS \n to the end of text if it isn't already there.
How many? Ideally, since you're looking for an inverse, you'd want to
replace however many were chomped off, right?
>
> If there is chomp there should be unchomp- the reasons for including it are
> the same as for including chomp. If chomp is optimized so too can unchomp.
>
> Having chomp without unchomp would be like having <= but not having >=
> [see note]. Sure you can get by without it- just change the order of the
> args, but why would you want to? If you have one, the other needs to be
> there for, if nothng else, parity.
>
chomp() uses $/, I believe. $\ is the inverse of $/, and is used
automatically.
And it's fewer characters.
$\="\n";
print;
--
Bryan C. Warnock
([EMAIL PROTECTED])