Subject: | warn when $ENV{NLS_DATE_FORMAT} doesn't exist |
Thanks for this great module, it was exactly what I was looking for.
I'm using it under mod_perl. mod_perl seems to be clobbering the
NLS_DATE_FORMAT env variable. I'm not sure why that is happening, and
I've worked around it by setting it every where the database handle is
requested.
This patch warns when NLS_DATE_FORMAT can't be determined:
--- DateTime/Format/Oracle.pm 2006-11-03 20:46:32.000000000 -0800
+++ /usr/lib/perl5/site_perl/5.8.5/DateTime/Format/Oracle.pm
2007-05-14 11:32:47.000000000 -0700
@@ -55,7 +55,14 @@
=cut
-sub nls_date_format { $ENV{NLS_DATE_FORMAT} }
+sub nls_date_format {
+ if ( exists $ENV{NLS_DATE_FORMAT} ) {
+ return $ENV{NLS_DATE_FORMAT};
+ } else {
+ warn "NLS_DATE_FORMAT environment variable not set.
Defaulting to 'YYYY-MM-DD HH24:MI:SS'";
+ return 'YYYY-MM-DD HH24:MI:SS';
+ }
+}
=item * parse_datetime