Loading ...
Sorry, an error occurred while loading the content.

577Autovivification issues w/ Perl 5.7

Expand Messages
  • igorp@photonet.com
    Jul 5, 2001
    • 0 Attachment
      I've just installed SOAP::Lite 0.50 with Perl 5.7.0, and have
      experienced several fatal errors, like "Use of uninitialized value"
      and "use an undefined value as a HASH reference". In addition,
      parsing is messed up - Expat creates empty slot for any text content,
      so making "Hello world" example to be silent :)

      As far as I see, the reason is that 5.7 is somewhat more restrictive
      with autovivification of references, than 5.6. For instance, it
      doesn't define it automatically in code like following:

      my $c;
      for ($c) { $_->{key} = "value" }

      However, it still works in "direct" case:

      my $c;
      $c->{key} = "value";

      In 5.6 both cases are valid.
      I didn't check yet the status of this feature - perhaps, it is not
      intended, and has to be fixed in next releases of Perl. Meanwhile,
      explicit initialization helps with 5.7 and make no harm with 5.6:

      # SOAP::Parser
      sub char { (shift->{_values}->[-1]->[3] ||= "") .= shift }

      # SOAP::Schema::WSDL
      $services{$opername} ||= {};

      Igor Pechersky,
      PictureVision, Inc.
    • Show all 2 messages in this topic