The date and time functions supplied with Perl (gmtime and localtime)
supply adequate information to determine the year well beyond 2000
(2038 is when trouble strikes for 32-bit machines). The year returned
-by these functions when used in an array context is the year minus 1900.
+by these functions when used in a list context is the year minus 1900.
For years between 1910 and 1999 this I<happens> to be a 2-digit decimal
number. To avoid the year 2000 problem simply do not treat the year as
a 2-digit number. It isn't.
If you are serious about writing a parser, there are a number of
modules or oddities that will make your life a lot easier. There are
the CPAN modules Parse::RecDescent, Parse::Yapp, and Text::Balanced;
-the byacc program; and Mark-Jason
-Dominus's excellent I<py> tool at http://www.plover.com/%7Emjd/perl/py/
-.
+and the byacc program.
One simple destructive, inside-out approach that you might try is to
pull out the smallest nesting parts one at a time:
Or you could check out the String::Scanf module on CPAN instead. The
POSIX module (part of the standard Perl distribution) provides the
-C<strtol> and C<strtod> for converting strings to double and longs,
+C<strtod> and C<strtol> for converting strings to double and longs,
respectively.
=head2 How do I keep persistent data across program calls?