[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] perl crashing with debugger



If I run a script with the debugger on twice, perl crashes the computer.
Seems odd to me that I should catch this but I don't see any other reports
on the same problem.

Let me know what else I can do to help resolve the problem.

Environment:

MacPerl 5.1.4r4
MacOS 8.0
minimal number of extensions


the script:

$/ = "\012";
@ARGV = ('Mac 424:webserv1.access',
         'Mac 424:webserv2.access');

#use strict;
print "begin\n";
# open log named in first command line argument
my $lognum = 0;
my $hightime='9999/99/99:99:99:99';
my @LOGS;
foreach (@ARGV) {
	$lognum++;
	my $log = &newFile("LOG".$lognum);
	print $log, "\n";
	open ($log, $_) || die ("cannot open log: '$ARGV[0]'");
	push @LOGS, $log;
}
open (OUTLOG, '>Mac 424:webserv.access');
my %month = qw(Jan 01 Feb 02 Mar 03 Apr 04 May 05 Jun 06
			   Jul 07 Aug 08 Sep 09 Oct 10 Nov 11 Dec 12);
my ($line, $ts, @lines, @ts);
foreach (@LOGS) {
	($line, $ts) = &nextLine($_);
	push @lines, $line;
	push @ts, $ts;
}
my ($min, $i);
while ($min ne $hightime) {
	$min = $hightime;
	# find lowest time
	foreach (@ts) {
		if ($_ lt $min) {
			$min = $_;
		}
	}
	# peel off lowest times
	for ($i = 0; $i <= @LOGS; $i++) {
		if ($ts[$i] eq $min) {
			print OUTLOG $lines[$i];
			print $lines[$i];
			($lines[$i], $ts[$i]) = &nextLine($LOGS[$i]);
		}
	}
}
print "end\n";

sub newFile {
	my ($handlename) = @_;
	local *{$handlename};
	return \*{$handlename};
}

sub nextLine{
	my ($log) = @_;
	my ($ts, $line, $d, $m, $y, $t);
	$ts = $hightime;
	$line = '';
	while ((not(eof $log)) && ($ts eq $hightime)) {
		$line = <$log>;
		print $log, $line, $ts, "\n";
		($d, $m, $y, $t) = ($line =~
/\S+\s+\S+\s+\S+\s\[(\w+)\/(\w+)\/(\w+)(\S+)\s/);
		if ($d) {
			$ts = "$y/$month{$m}/$d$t";
		}
	}
	return $line, $ts;
}


------------------------------------------------------------------------
Chuck Griffith
612-673-4105



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch