On Wed, 12 Dec 2001, Brett W. McCoy wrote:

> > I have a pain in the butt array that SOMETIMES has a CR at the end and
> > sometimes does not.  Can anyone think of a way to test to see if the \n is
> > there and if it is then chop else no chop?  Cause if I just use chop then it
> > starts chopping off letters sometimes...
>
> Don't use chop, use chomp.  It does exactly what you want -- technically,
> it chops off $?, which by default is \n, but doesn't chop it if it's not
> there.  You can test the return value of chomp to see how many characters
> it removed.

My hand didn't make it off the shift key when I was typing $?.  That
should be $/!!!!!!!!!!!!!!!!

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
A strong conviction that something must be done is the parent of many
bad measures.
                -- Daniel Webster


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to