simple question on perl

Sean picasso@madflower.com
Fri, 1 Sep 2000 11:49:24 -0400 (EDT)


It would actually be:
$one_char = chop($string) ;

or 
$one_char = substr ($string -1, 1);


On Fri, 1 Sep 2000, Dpk wrote:

> On Fri, Sep 01, 2000 at 02:57:06PM -0400, Adam McDougall wrote:
> 
>    chop or chomp?
> 
> chomp *only* removes the trailing character if it is a newline and is
> a good/safe replacement for chop in the case removing a carriage
> return.
> 
> chop removes the last character regardless of what it is.
> 
> dpk
> 
>    On Fri, 1 Sep 2000, Daniel R . Kilbourne wrote:
>    
>    > Call me a perl idiot, but how do I remove the last character from
>    > a string?
>    > 
>    > I will need to pull the last character from a line such as:
>    > 
>    > 3.3219333333e+02  (I need to get the 2 in this case)
>    > 
>    > the string will always be of constant length.
>    > 
>    > Anyone?
>    > 
>    > ___
>    > Dan
>    > _______________________________________________
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user
>