This had bugged me too. But the solution I had arrived at is slightly
different. What do you think?
($retval, $scalar) = chomp $scalar;
or
($retval, @list) = chomp @list;
In list mode chomp returns a list whose first element is the return value,
the remainder being the modified value(s).
In cur
chomp should have options to define what an EOL is.
Many times, on Solaris, I could not use chomp because I had to use
=~ s/[\n\r ]$//
on files that came from NT or even from MS-oriented unix editors.
Lightning flashed, thunder crashed and Nathan Wiger <[EMAIL PROTECTED]> whisper
ed:
| I suggest a modification to this RFC: if chomp() is called without args,
| it modifies $_ directly, consistent with its current implementation.
| That way you can write:
If it is called without args, it really i
Bart Lateur said:
> So what are these really good for? To get rid of the line terminator, or
> "Record Separator", when reading from a file. That is what they are for,
> that is what we should facilitate. Not the chop()ping or chomp()ing of
> just any string.
>
> So, let's keep in tune with the R
Michael Mathews wrote:
>
> Like "join" the order of arguments would have to be "chomp($thing_to_remove,
> @array)" but this spoils the default behavior of $thing_to_remove being
> optional...
>
> unless you think we should require arrays to be passed by reference.
Well, if we were really talkin
Ted Ashton said:
> Thus it was written in the epistle of Uri Guttman,
> >
> > how do you tell the above two apart? by array do you mean only an array
> > variable? then you can't chomp a list of scalar values or multiple
> > arrays, etc.
> >
> > this needs to be clarified.
>
> Quite true. The two