Hi,

I have tried the following sample of using inner/augment from the Moose manual:

package Document;

use Moose;

sub as_xml {
  my $self = shift;

  my $xml = "<document>\n";
  $xml .= inner();
  $xml .= "</document>\n";

  return $xml;
}

package Report;

use Moose;
extends 'Document';

augment 'as_xml' => sub {
  my $self = shift;

  my $xml = "<report>\n";
  $xml .= inner();
  $xml .= "</report>\n";

  return $xml;
};

package main;

Report->new->as_xml;

The single result given is:

Use of uninitialized value in concatenation (.) or string at 
E:\lucru\moose\3\test.pl line 25.

The line 25 is:

  $xml .= inner();

(from the augment modifier)

Am I missing something from the sample script?

Thanks.

Octavian

Reply via email to