in reply to getVars bug kills full-page chat
The following patch should resolve this problem.
--- orig\Everything.pm 2004-12-27 13:17:23.025625000 +0100 +++ new\Everything.pm 2004-12-27 13:20:39.213125000 +0100 @@ -349,6 +349,7 @@ printLog("Undefined type in unpackVars()"); return "Error undef type"; } elsif ($type eq 'H') { + $vars={}; for (split /\Q$split\E/, $vars_str) { my ($k,$v)= split /!/, $_, 2; for ( $k,$v ) { @@ -364,6 +365,7 @@ $vars->{$k} = $v; } } elsif ($type eq 'A') { + $vars=[]; for (split /\Q$split\E/, $vars_str) { s/~(\w\w)/ chr(hex($1)) /ge; push @$vars, $_ eq 'U'
And while we are talking about patching PM modules, Id like to know what policy we have with version numbers in the modules. It doesnt seem like we bump the version numbers when we patch, and unless im totally mistaken they are far different from the similarly numbered version from Everything Development. Perhaps we should start a new version sequence? Maybe call ours Version=100.0 or something and then increment from there?
A last question I have concerns the loging mechansim:
sub printLog { my $entry = $_[0]; my $time = getTime(); # prefix the date a time on the log entry. $entry = "$time: $entry\n"; if(open(ELOG, ">> $everythingLog")) { print ELOG $entry; close(ELOG); } return 1; }
It opens and closes the file for every statement!! IMO it should look more like the following (untested) snippet:
{ my $logfile; my $loghandle; use Fcntl qw(:DEFAULT :flock); require POSIX; sub printLog { if (!$loghandle or $logfile ne $everythingLog) { $logfile=$everythingLog; open $loghandle,">>",$logfile or return; } my $time = POSIX::strftime( "%Y-%m-%d %H:%M:%S >", localtime() ); flock( $loghandle, LOCK_EX ) or return; seek( $loghandle, 0, 2 ) or return; # prefix the date and time on the log entry. print $loghandle map("$time: $_\n",@_) or return; flock( $loghandle, LOCK_UN ) or return; return 1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getVars bug kills full-page chat (versions, open)
by tye (Sage) on Dec 28, 2004 at 03:39 UTC | |
by demerphq (Chancellor) on Dec 28, 2004 at 09:26 UTC | |
|
Re^2: getVars bug kills full-page chat
by Corion (Patriarch) on Dec 27, 2004 at 17:11 UTC | |
|
Re^2: getVars bug kills full-page chat (fixed)
by tye (Sage) on Jan 07, 2005 at 05:07 UTC |