in reply to Re^3: GMT to PST format
in thread GMT to PST format
Can't locate object method "new" via package "Date::Manip" at#!/usr/bin/perl use strict; use warnings; use Date::Manip; my $date_manip_object = new Date::Manip; $date_manip_object->parse( '2 days ago' ); $date_manip_object->convert( 'GMT' ); my $gmt_ref = $date_manip_object->printf( '%Y%m%d') ; while (<DATA>) { my $err = $date_manip_object->parse_format('.*?\\[%d/%b/%Y:%T\s+%z +\\].*', $_); next if $err; # skip (?) lines that do not match the date format my $input_line_date = $date_manip_object->printf( '%Y%m%d') ; if ($input_line_date eq $gmt_ref) { print; } } __DATA__ 10.1.10.178 - - [15/Jun/2010:23:30:34 +0000] - 10.1.10.178 - - [16/Jun/2010:23:30:34 +0000] -
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: GMT to PST format
by Corion (Patriarch) on Jun 20, 2010 at 08:38 UTC | |
by Anonymous Monk on Jun 20, 2010 at 08:44 UTC | |
by Corion (Patriarch) on Jun 20, 2010 at 08:56 UTC | |
by Anonymous Monk on Jun 20, 2010 at 08:49 UTC |