that's the whole code

apache;s log is being parsed

open LOG_FILE, "</access_log";
while(<LOG_FILE>) {


$_=~s/Jan/1/ig;
$_=~s/Feb/2/ig;
$_=~s/Mar/3/ig;
$_=~s/Apr/4/ig;
$_=~s/May/5/ig;
$_=~s/Jun/6/ig;
$_=~s/Jul/7/ig;
$_=~s/Aug/8/ig;
$_=~s/Sep/9/ig;
$_=~s/Oct/10/ig;
$_=~s/Nov/11/ig;
$_=~s/Dec/12/ig;





@fields=split(/ /, $_);
$datetime=substr($fields[3],1);
@fields=split(/[\/:]/, $datetime);

my $cur_datetime=DateTime->new(year=>$fields[2],
 month=>$fields[1], day=>$fields[0], hour=>$fields[3],
 minute=>$fields[4], second=>$fields[5]);

}





From: Marcello <[EMAIL PROTECTED]>
To: beginners@perl.org
Date: Thursday, October 6, 2005, 4:23:24 PM
Subject: datetime odd problem



  Thursday, October 6, 2005, 4:23:24 PM, you wrote:

  > John ha scritto:
>> THe following code
>> 
>> my $cur_datetime=DateTime->new(year=>$fields[2],
>> month=>$fields[1], day=>$fields[0], hour=>$fields[3],
>> minute=>$fields[4], second=>$fields[5]);
>> 
>> is working properly on a 32-bit Suse Linux
>> 
>> but not in a 64-bit Suse Linux
>> 
>> giving the error below
>> 
>> The 'hour' parameter (undef) to DateTime::new was an 'undef',
>> which is not one of the allowed types: scalar
>> 
>> The module DateTime is the exaclty the same.
>> 
>> Any idea on what might be going wrong?
>> 
>> 
>> 

> I think you should show us where those $fields come from.

> -- 
> Marcello Romani
> Developer
> Spin s.r.l.
> Reggio Emilia
> http://www.spinsoft.it








-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to