My first reaction was "NOOOOOOO!!" we'll break too much code!
Now, I'm not so sure. Nearly always, chomp() is what is called for;
how often *do* you need to chop off the last character of a string?
And, as someone else pointed out, why not the first character?
"Al" wrote:
>I would actualy like to see chop expanded to allow a variable number of
>characters to be removed and a sister function to cut the head off. Yes I
>know you can do this with substr but sometimes when you want the performance
>and need to cut up a string into fields. Lets say the new function is called
>'take'.
Oh, no no no no. The obvious choice of function name is 'chip' :-)
> while($str =<F>)
> {
> $head = take($str,40);
> $tail = chop($str,40);
> $middle = $str;
> #assuming $str had 120 characters in it
> }
Although... if you're going to generalize it this way, why not call
them LEFT$ and RIGHT$, and rename substr() to MID$? Ugh...
----------------------------------------------------------------------
Eric J. Roode, [EMAIL PROTECTED] print scalar reverse sort
Senior Software Engineer 'tona ', 'reh', 'ekca', 'lre',
Myxa Corporation '.r', 'h ', 'uj', 'p ', 'ts';