SPUG: number inside of a number

Kevin Fink kevin-spug at fink.com
Tue Sep 19 17:10:55 PDT 2006


if(substr($number,-1,1) == 5)


luis medrano wrote:
> List,
> 
> I have a question, I need a variable where is holding a value (number) 
> but I need to check and verify the last digit. For example :
> My $number=98765;
> 
> if ($number  last digit is 5)
> 
> I really appreciate you help.
> 
> Thanks,
> Luis
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________________________________
> Seattle Perl Users Group Mailing List  
>      POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>     MEETINGS: 3rd Tuesdays
>     WEB PAGE: http://seattleperl.org/



More information about the spug-list mailing list