Mailing List Archive



Back to the month index Back to the list index

J. M. Castagnetto (jcastagnetto@hotmail.com)
Fri, 09 Apr 1999 18:49:09 PDT


Message-ID: <19990410014909.91593.qmail@hotmail.com>
From: "J. M. Castagnetto" <jcastagnetto@hotmail.com>
Subject: Re: Converting a 6 digit date to mSQL Date format
Date: Fri, 09 Apr 1999 18:49:09 PDT

How about just creating an array:
$m[1] = "-Jan-";
(...)
$m[12] = "-Dec-";

and then just using:

$msqldate = $day + $m[(int)strseg($row[1],2,3)] + $year;

This should (in principle) work, as strseg() returns a string, so you
should only need one typecasting.

The array is also faster, no need to segment the string 12 times to
compare.

HTH, and good luck.

>From: "David Palmer" <davidp@wsa.net.au>
>Reply-To: davidp@wsa.net.au
>To: Multiple recipients of list <msql-list@services.bunyip.com>
>Subject: Converting a 6 digit date to mSQL Date format
>Date: Thu, 8 Apr 1999 04:29:22 -0400 (EDT)
>
>Hello,
>
>Does anybody know a way to convert a 6 digit Australian date (ddmmyy)
eg.
>010499 into an mSQL date format. eg. 01-Apr-1999 using the Lite
scripting
>language ?
>
>I tried the below code but it didn't work.
>$row[1] is the variable holding the value 010499
>
>
>$day = strseg($row[1],0,1);
>$yr = strseg($row[1],4,5);
>
>$mth = sub(strseg($row[1],2,3),"01","-Jan-");
>$mth = sub(strseg($row[1],2,3),"02","-Feb-");
>$mth = sub(strseg($row[1],2,3),"03","-Mar-");
>$mth = sub(strseg($row[1],2,3),"04","-Apr-");
>$mth = sub(strseg($row[1],2,3),"05","-May-");
>$mth = sub(strseg($row[1],2,3),"06","-Jun-");
>$mth = sub(strseg($row[1],2,3),"07","-Jul-");
>$mth = sub(strseg($row[1],2,3),"08","-Aug-");
>$mth = sub(strseg($row[1],2,3),"09","-Sep-");
>$mth = sub(strseg($row[1],2,3),"10","-Oct-");
>$mth = sub(strseg($row[1],2,3),"11","-Nov-");
>$mth = sub(strseg($row[1],2,3),"12","-Dec-");
>
>$msqldate = $day + $mth + $yr;
>
>The variable echo's the value 04 instead of -Apr-
>
>Any ideas on this ?
>
>
>

=====
Jesus M. Castagnetto - jcastagnetto@hotmail.com
Pilot stuff & etc.:
  http://www.geocities.com/ResearchTriangle/Lab/1059/
LAB: http://www.scripps.edu/research/metallo
Metalloprotein DB: http://metallo.scripps.edu/

_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com
From jcastagnetto@hotmail.com Fri Apr 9 21:52:33 1999
Received: from hotmail.com (wya-oe4.hotmail.com [207.82.253.69])
        by services.bunyip.com (8.8.5/8.8.5) with SMTP id VAA08733
        for <msql-list@services.bunyip.com>; Fri, 9 Apr 1999 21:52:33 -0400 (EDT)
Received: (qmail 46879 invoked by uid 0); 10 Apr 1999 01:52:16 -0000
Message-ID: <19990410015216.46878.qmail@hotmail.com>
Received: from 137.131.240.50 by wy1lg.hotmail.com with HTTP;
        Fri, 09 Apr 1999 18:52:16 PDT
X-Originating-IP: [137.131.240.50]
From: "J. M. Castagnetto" <jcastagnetto@hotmail.com>
To: davidp@wsa.net.au, msql-list@services.bunyip.com
Subject: Re: Converting a 6 digit date to mSQL Date format (Part 2)
Date: Fri, 09 Apr 1999 18:52:16 PDT
Mime-Version: 1.0
Content-type: text/plain

I just noticed:

[snip]
>$day = strseg($row[1],0,1);
>$yr = strseg($row[1],4,5);

Shouldn't it be: $yr = "19" + strseg($row[1],4,5);

to get the 4 digit year you need later?

[snip]
>$msqldate = $day + $mth + $yr;
[snip]

Regards.

=====
Jesus M. Castagnetto - jcastagnetto@hotmail.com
Pilot stuff & etc.:
  http://www.geocities.com/ResearchTriangle/Lab/1059/
LAB: http://www.scripps.edu/research/metallo
Metalloprotein DB: http://metallo.scripps.edu/

_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com
From jmcdermo@lanl.gov Sat Apr 10 05:10:42 1999
Received: from mailhost3.lanl.gov (mailhost3.lanl.gov [128.165.3.9])
        by services.bunyip.com (8.8.5/8.8.5) with ESMTP id FAA13946
        for <msql-list@services.bunyip.com>; Sat, 10 Apr 1999 05:10:41 -0400 (EDT)
Received: from cic-mail.lanl.gov (cic-mail.lanl.gov [128.165.3.68])
        by mailhost3.lanl.gov (8.9.3/8.9.3/(cic-5, 2/8/99)) with ESMTP id DAA25373
        for <msql-list@services.bunyip.com>; Sat, 10 Apr 1999 03:10:09 -0600
Received: from [128.165.7.103] (ts-usr-103.lanl.gov [128.165.7.103])
        by cic-mail.lanl.gov (8.9.3/8.9.3/(cic-5, 2/9/99)) with ESMTP id DAA28827
        for <msql-list@services.bunyip.com>; Sat, 10 Apr 1999 03:10:06 -0600 (MDT)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: jmcdermo@cic-mail.lanl.gov
Message-Id: <v04204d0bb334c497771b@[128.165.7.103]>
Date: Sat, 10 Apr 1999 03:09:52 -0600
To: msql-list@services.bunyip.com
From: John McDermon <jmcdermo@lanl.gov>
Subject: mod-perl demo?
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by services.bunyip.com id FAA13946

I'm trying to run the mod-perl demo from chapt 11 of the book. I'm using mod-perl 1.19, Perl 5.05_2, and Msql 2.08. I've updated all the modules from CPAN that I can think of. But, when I run the mod_perl_example.pl I get the following error in my server logs:

httpd: [Sat Apr 10 03:03:29 1999] [error] Can't locate loadable object for module DBI in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1 /opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-RISC1.1 /opt/perl5/lib/site_perl/5.005 . /opt/apache/ /opt/apache/lib/perl) at /opt/perl5/lib/site_perl/5.005/PA-RISC1.1/DBI.pm line 0
BEGIN failed--compilation aborted at /opt/perl5/lib/site_perl/5.005/PA-RISC1.1/DBI.pm line 168.
BEGIN failed--compilation aborted at /opt/perl5/mod-perl/mod_perl_example.pl line 16.

Line 0 of DBI.pm says:
require 5.003;

I tried changing it to 5.05, but I got the same results.

Any Ideas?
--John

+-------------------------------------------------+
| John McDermon, voice mail 7-7315 Fax 5-1002 |
| CIC-2, MS F608 cell 699-4910, page 104-8665 |
+-------------------------------------------------+
From jmcdermo@lanl.gov Sat Apr 10 05:15:44 1999
Received: from mailhost3.lanl.gov (mailhost3.lanl.gov [128.165.3.9])
        by services.bunyip.com (8.8.5/8.8.5) with ESMTP id FAA14053
        for <msql-list@services.bunyip.com>; Sat, 10 Apr 1999 05:15:44 -0400 (EDT)
Received: from cic-mail.lanl.gov (cic-mail.lanl.gov [128.165.3.68])
        by mailhost3.lanl.gov (8.9.3/8.9.3/(cic-5, 2/8/99)) with ESMTP id DAA25400;
        Sat, 10 Apr 1999 03:14:40 -0600
Received: from [128.165.7.103] (ts-usr-103.lanl.gov [128.165.7.103])
        by cic-mail.lanl.gov (8.9.3/8.9.3/(cic-5, 2/9/99)) with ESMTP id DAA29139;
        Sat, 10 Apr 1999 03:14:35 -0600 (MDT)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
X-Sender: jmcdermo@cic-mail.lanl.gov
Message-Id: <v04204d0cb334c5e9c783@[128.165.7.103]>
In-Reply-To: <Pine.BSF.3.96.990409150700.4209H-100000@fawn.hughes.com.au>
References: <Pine.BSF.3.96.990409150700.4209H-100000@fawn.hughes.com.au>
Date: Sat, 10 Apr 1999 03:14:23 -0600
To: bambi@Hughes.com.au
From: John McDermon <jmcdermo@lanl.gov>
Subject: Re: 2.0.8 HP Compile
Cc: msql-list@services.bunyip.com, ol@twics.com

I got it to compile with the HP compiler on HPUX 10.20 by adding

LINK_ONLY_FLAGS= -lPW -L/usr/lib

to the site.mm file.

I haven't installed it, since I need the gcc compiled libraries for
compatibility, but it looked like ist built just fine

Good Luck,
--John
>On Thu, 8 Apr 1999, Kevin Baker wrote:
>
> > the MSYNC_3 bit got me along further but now it is falling over with a
> > different error (see below). The linker can't find alloca which I find
> > confusing.
>
>This is looking ugly. Any HP'ers out there that could offer some advice?
>
>
>Bambi
>..

+-------------------------------------------------+
| John McDermon, voice mail 7-7315 Fax 5-1002 |
| CIC-2, MS F608 cell 699-4910, page 104-8665 |
+-------------------------------------------------+
From bjepson@home.com Sat Apr 10 11:15:47 1999
Received: from mail.rdc1.ct.home.com (imail@ha1.rdc1.ct.home.com [24.2.0.66])
        by services.bunyip.com (8.8.5/8.8.5) with ESMTP id LAA17910
        for <msql-list@services.bunyip.com>; Sat, 10 Apr 1999 11:15:46 -0400 (EDT)
Received: from cx384756-a.sking1.ri.home.com ([24.4.176.83])
          by mail.rdc1.ct.home.com (InterMail v4.00.03 201-229-104)
          with ESMTP
          id <19990410151544.XQOS1357.mail.rdc1.ct.home.com@cx384756-a.sking1.ri.home.com>;
          Sat, 10 Apr 1999 08:15:44 -0700
Date: Sat, 10 Apr 1999 11:17:54 -0500 (EST)
From: Brian Jepson <bjepson@home.com>
X-Sender: bjepson@cx384756-a.sking1.ri.home.com
To: John McDermon <jmcdermo@lanl.gov>
cc: Multiple recipients of list <msql-list@services.bunyip.com>
Subject: Re: mod-perl demo?
In-Reply-To: <v04204d0bb334c497771b@[128.165.7.103]>
Message-ID: <Pine.LNX.4.10.9904101112170.923-100000@cx384756-a.sking1.ri.home.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Sat, 10 Apr 1999, John McDermon wrote:

> I'm trying to run the mod-perl demo from chapt 11 of the book. I'm
> using mod-perl 1.19, Perl 5.05_2, and Msql 2.08. I've updated all the
> modules from CPAN that I can think of. But, when I run the
> mod_perl_example.pl I get the following error in my server logs:
>
> httpd: [Sat Apr 10 03:03:29 1999] [error] Can't locate loadable object for module DBI in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1 /opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-RISC1.1 /opt/perl5/lib/site_perl/5.005 . /opt/apache/ /opt/apache/lib/perl) at /opt/perl5/lib/site_perl/5.005/PA-RISC1.1/DBI.pm line 0
> BEGIN failed--compilation aborted at /opt/perl5/lib/site_perl/5.005/PA-RISC1.1/DBI.pm line 168.
> BEGIN failed--compilation aborted at /opt/perl5/mod-perl/mod_perl_example.pl line 16.
>
> Line 0 of DBI.pm says:
> require 5.003;
>
> I tried changing it to 5.05, but I got the same results.
>

require 5.003; says to require a minimum of 5.003 -- don't change that to
5.05, since we're only up to 5.005, and 5.005 < 5.05!

It looks like the shared library from DBI can't be loaded. Did you
install DBI as directed? Did it pass all tests? Can you try reinstalling
DBI? If you haven't already, please check the DBI README file thoroughly.

This looks to me like DBI only managed to partially install itself. If
you see any funny stuff during "make test" or "make install", that might
give us some things to look at.

Hope this helps,

Brian Jepson * (bjepson@home.com) * http://users.ids.net/~bjepson