Item14759: Error messages/warnings from PublishPlugin (when publishing from the command line)
Priority: Normal
Current State: New
Released In: n/a
Target Release: n/a
Steps to reproduce
-
cd /path/to/your/foswiki/bin
-
perl rest /PublishPlugin/publish format=file topic=Main.WebHome
Error messages
Variable "$this" will not stay shared at ... lib/Foswiki/Plugins/PublishPlugin/Publisher.pm
(W closure) An inner (nested) named subroutine is referencing a
lexical variable defined in an outer named subroutine.
When the inner subroutine is called, it will see the value of
the outer subroutine's variable as it was before and during the *first*
call to the outer subroutine; in this case, after the first call to the
outer subroutine is complete, the inner and outer subroutines will no
longer share a common value for the variable. In other words, the
variable will no longer be shared.
This problem can usually be solved by making the inner subroutine
anonymous, using the sub {} syntax. When inner anonymous subs that
reference variables in outer subroutines are created, they
are automatically rebound to the current values of such variables.
Use of uninitialized value in concatenation (.) or string at ... lib/Foswiki/Plugins/PublishPlugin/Publisher.pm line
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.
To help you figure out what was undefined, perl will try to tell you
the name of the variable (if any) that was undefined. In some cases
it cannot do this, so it also tells you what operation you used the
undefined value in. Note, however, that perl optimizes your program
and the operation displayed in the warning may not necessarily appear
literally in your program. For example, "that $foo" is usually
optimized into "that " . $foo, and the warning will refer to the
concatenation (.) operator, even though there is no . in
your program.
Environment
System running Debian 9.5 (Stretch), Perl v5.24.1, Foswiki 2.1.6, PublishPlugin 3.4 (30 Jan 2018 ).
Discussion
Bugs me.
--
RobertSchuettler - 17 Sep 2018