I couldn't take the sub calculate_time as written. Below is a version w/ duplications reduced, does not solve the actual problem of printing data in the intervals (see OP).

# Jun 20 2003 - create hash w/ "map" instead of explicit creation my %MonthToNumber; @MonthToNumber{qw (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)} = map { sprintf "%02d" , $_; } (1..12); my %NumberToMonth = map { $MonthToNumber{$_} => $_ } keys %MonthToNumber; sub calculate_time { my $get_sec = sub { my @time = reverse @{ parse_date($_[0]) }; return # second, minute, hour, day month year timelocal(@time[0..(scalar @time -3)] , $time[-2] -1 , $time[- +1]); }; my ($begin_sec , $end_sec) = ( $get_sec->($begin_time) , $get_sec->($dateproc) ); my $elapsed = $end_sec - $begin_sec; #printf "BEGIN: %s(%s) END: %s(%s)\nELAPSED: %s\n" # , $begin_sec , $begin_time # , $end_sec , $dateproc # , $elapsed; if ( $elapsed < $interval ) { push (my @visual_page_values, {$processed_visual_pages{$dateproc}} +); print "The End seconds are: $dateproc @{$processed_visual_pages{$ +dateproc}}\n"; } else { $begin_time = $dateproc; push (@final_visual_pages, $dateproc); print " Final Visual pages are: @final_visual_pages\n"; } } sub parse_date { my $date = shift; return [ ] unless defined $date; my ($day, $month, $year, $hour, $minute, $second) = split '[/:]' , $date; return [ $year , $MonthToNumber{$month} , $day , $hour , $minute , $second ]; }

Other Notes (Jun 20 2003):


In reply to Re: Re: Re: Parsing of the web log file, access_log by parv
in thread Parsing of the web log file, access_log by Andy61

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.