CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Comparing dates

 



perlfarmer
User

Jun 1, 2009, 6:24 AM

Post #1 of 2 (191 views)
Comparing dates Can't Post

I am trying to compare strings representing dates. Since the dates often start with a leading zero I am stripping any leading zeroes, converting the strings to integers and comparing them as numbers. What module do I need to include in the program to use the atoi function?

Thanks.


KevinR
Veteran


Jun 1, 2009, 10:12 AM

Post #2 of 2 (184 views)
Re: [perlfarmer] Comparing dates [In reply to] Can't Post

Perl only has one basic data type, the scalar. Perl treats scalars as strings or numbers (or references) correctly without having to do anything. Just use the correct operators for numbers and the correct operators for strings and perl knows what to do.

http://perldoc.perl.org/perldata.html#Scalar-values
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives