Slight patch to Perlbal.pm
Ask Bjørn Hansen
ask at develooper.com
Tue Jan 15 23:46:30 UTC 2008
5.*8* is more than 5 years old now, so 5.6 is definitely a reasonable
requirement.
Are there even any systems with kqueue/epoll/... support that don't
have 5.8?
--
http://develooper.com
On Jan 15, 2008, at 15:15, dormando <dormando at rydia.net> wrote:
> Scoped filehandles are an addition in perl 5.6, so this'll break
> compat with 5.05 and friends...
>
> ... I guess the question is, does perlbal actually work with perl
> pre-5.6 right now? I have no idea :) If not, and no one cares, we
> can probably merge after a quick test.
>
> -Dormando
>
> Eamon Daly wrote:
>> While writing a plugin to allow multiple config files, I
>> noticed that Perlbal::load_config uses a typeglob filehandle
>> rather than a locally-scoped one, which means it'll throw
>> warnings if called recursively. This (trivial) patch fixes
>> that:
>> --- /usr/lib/perl5/site_perl/5.8.5/Perlbal.pm 2007-10-23 23:09:08.000000000 -0500
>> +++ /var/www/lib/Perlbal.pm 2008-01-15 14:49:22.000000000 -0600
>> @@ -1135,14 +1135,14 @@
>> sub load_config {
>> my ($file, $writer) = @_;
>> - open (F, $file) or die "Error opening config file ($file): $!
>> \n";
>> + open(my $fh, $file) or die "Error opening config file ($file):
>> $!\n";
>> my $ctx = Perlbal::CommandContext->new;
>> $ctx->verbose(0);
>> - while (my $line = <F>) {
>> + while (my $line = <$fh>) {
>> $line =~ s/\$(\w+)/$ENV{$1}/g;
>> return 0 unless run_manage_command($line, $writer, $ctx);
>> }
>> - close(F);
>> + close($fh);
>> return 1;
>> }
>> ____________________________________________________________
>> Eamon Daly
More information about the perlbal
mailing list