[Chicago-talk] Scalar question?

Richard Reina richard at rushlogistics.com
Fri Apr 1 08:04:41 PST 2005


Thanks Warren, that's exactly what I needed.

Richard
--- Warren Smith <warren at warrenandrachel.com> wrote:

> my $s = substr($scalar, -3);
> 
> On Fri, 2005-04-01 at 05:43 -0800, Richard Reina
> wrote:
> > my $scalar = "whisky";
> > 
> > If this gives me the last 3 characters of the
> string
> > "whisky":
> > 
> > my $s = substr(3,3,$scalar); 
> > 
> > How can I get the last three letters of any string
> > regardless of the strings length (given that the
> > string will be atleast three characters long)?
> > 
> > Any help would be graetly appreciated.
> > 
> > Thanks
> > _______________________________________________
> > Chicago-talk mailing list
> > Chicago-talk at pm.org
> > http://mail.pm.org/mailman/listinfo/chicago-talk
> > 
> 
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 



More information about the Chicago-talk mailing list