cvs commit: p5ee/App-Context/lib/App Response.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/08/09 12:04:07

  Modified:    App-Context/lib/App Response.pm
  Log:
  include files support
  
  Revision  Changes    Path
  1.7       +18 -3     p5ee/App-Context/lib/App/Response.pm
  
  Index: Response.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Context/lib/App/Response.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Response.pm	10 Nov 2004 15:37:51 -0000	1.6
  +++ Response.pm	9 Aug 2005 19:04:07 -0000	1.7
  @@ -213,9 +213,24 @@
   sub include {
       &App::sub_entry if ($App::trace);
       my ($self, $type, $content) = @_;
  -    $self->{include}{$type}{$content} = 1;
  +    if (!$self->{include}{$type}{$content}) {
  +        if (!$self->{include}{"${type}_list"}) {
  +            $self->{include}{"${type}_list"} = [ $content ];
  +        }
  +        else {
  +            push(@{$self->{include}{"${type}_list"}}, $content);
  +        }
  +        $self->{include}{$type}{$content} = 1;
  +    }
       &App::sub_exit() if ($App::trace);
  -    return $self->{content};
  +}
  +
  +sub is_included {
  +    &App::sub_entry if ($App::trace);
  +    my ($self, $type, $content) = @_;
  +    my $included = $self->{include}{$type}{$content};
  +    &App::sub_exit($included) if ($App::trace);
  +    return($included);
   }
   
   1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.