=head2 How can I find the Julian Day?
-You could use Date::Calc's Delta_Days function and calculate the number
-of days from there. Assuming that's what you really want, that is.
+Use the Time::JulianDay module (part of the Time-modules bundle
+available from CPAN.)
Before you immerse yourself too deeply in this, be sure to verify that it
is the I<Julian> Day you really want. Are they really just interested in
the first meaning that you really want, then check out the Date::Manip
and Date::Calc modules. (Thanks to David Cassell for most of this text.)
-There is also an example of Julian date calculation that should help you in
-http://www.perl.com/CPAN/authors/David_Muir_Sharnoff/modules/Time/JulianDay.pm.gz
-
=head2 How do I find yesterday's date?
The C<time()> function returns the current time in seconds since the
# $_ contains the string to parse
# BEGIN and END are the opening and closing markers for the
# nested text.
-
+
@( = ('(','');
@) = (')','');
($re=$_)=~s/((BEGIN)|(END)|.)/$)[!$3]\Q$1\E$([!$2]/gs;
print "@lines"; # WRONG - extra blanks
print @lines; # right
-=head2 Why don't my E<lt>E<lt>HERE documents work?
+=head2 Why don't my <<HERE documents work?
Check for these three things:
@list = sort { $a <=> $b } @list;
The default sort function is cmp, string comparison, which would
-sort C<(1, 2, 10)> into C<(1, 10, 2)>. C<E<lt>=E<gt>>, used above, is
+sort C<(1, 2, 10)> into C<(1, 10, 2)>. C<< <=> >>, used above, is
the numerical comparison operator.
If you have a complicated function needed to pull out the part you
sub is_numeric { defined getnum($_[0]) }
-Or you could check out
-http://www.perl.com/CPAN/modules/by-module/String/String-Scanf-1.1.tar.gz
-instead. The POSIX module (part of the standard Perl distribution)
-provides the C<strtol> and C<strtod> for converting strings to double
-and longs, respectively.
+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,
+respectively.
=head2 How do I keep persistent data across program calls?