in reply to Re^2: "scalar found where operator expected" while printing to a glob ref
in thread "scalar found where operator expected" while printing to a glob ref

It does seem so, but I couldn't find that piece of code in XML::SAX::Writer, which is not really surprising since this is a syntax error, not just a warning.

  • Comment on Re^3: "scalar found where operator expected" while printing to a glob ref

Replies are listed 'Best First'.
Re^4: "scalar found where operator expected" while printing to a glob ref
by seki (Monk) on Mar 02, 2016 at 13:18 UTC
    Well, I've just checked and it is not the actual package code.
    I remember now that I found the example of custom ConsumerInterface in the documentation of XML::SAX::Writer
    sub output { my $self = shift; $$self .= uc shift; }
    and I have adapted it to my needs: replacing the string scalar to store the data by a file handle. Thus I am responsible for print $$self $data;. Actually I was surprised for not having the warning while using the stock module... Mea culpa.

      What line 3 ($$self .= uc shift) is saying (just for those not understanding the above code) is that it dereferences the thingy that $self points to, and appends the upper cased version of the next parameter to thingy, putting the results back into thingy.

      --MidLifeXis