simple question on perl

Sean picasso@madflower.com
Fri, 1 Sep 2000 14:15:14 -0400 (EDT)


Whoops so much for a syntaxually correct Friday. =)


On 1 Sep 2000, Ben Pfaff wrote:

> Sean <picasso@madflower.com> writes:
> 
> > $one_char = substr ($string -1, 1);
> 
> That doesn't take off the last character.  It subtracts 1 from
> $string and drops the first character.  You probably meant to
> include another `,':
> 	$last_char = substr ($string, -1, 1);
> although you can also leave off the last argument in this case:
> 	$last_char = substr ($string, -1);
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user
>