~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to docs/api/Apache2/PerlSections.pod

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2006-03-24 02:48:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060324024844-73oxqkcj2jmlmh2t
Tags: 2.0.2-2build1
Fake sync to bring in new upstream bugfixes, UVF exception by mdz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
will be feeding to the apache config gears. The output is suitable to
187
187
read back in via C<eval>.
188
188
 
 
189
  my $dump = Apache2::PerlSections->dump;
 
190
 
 
191
=over 4
 
192
 
 
193
=item ret: C<$dump> ( string / C<undef> )
 
194
 
 
195
A string dump of all the Perl code encountered in E<lt>PerlE<gt> blocks,
 
196
suitable to be read back via C<eval>
 
197
 
 
198
=back
 
199
 
189
200
For example:
190
201
 
191
202
  <Perl>
192
203
  
193
204
  $Apache2::PerlSections::Save = 1;
194
205
  
195
 
  $Port = 8529;
 
206
  $Listen = 8529;
196
207
  
197
208
  $Location{"/perl"} = {
198
209
     SetHandler => "perl-script",
222
233
 
223
234
This will print something like this:
224
235
 
225
 
  $Port = 8529;
 
236
  $Listen = 8529;
226
237
  
227
238
  @DirectoryIndex = (
228
239
    'index.htm',
265
276
This method will call the C<dump> method, writing the output
266
277
to a file, suitable to be pulled in via C<require> or C<do>.
267
278
 
 
279
  Apache2::PerlSections->store($filename);
 
280
 
 
281
=over 4
 
282
 
 
283
=item arg1: C<$filename> (string)
 
284
 
 
285
The filename to save the dump output to
 
286
 
 
287
=item ret: no return value
 
288
 
 
289
=back
 
290
 
268
291
 
269
292
 
270
293
 
286
309
And in My/PerlSection/Handler.pm:
287
310
 
288
311
  sub My::Handler::handler : handler {
289
 
      my($self, $parms, $args) = @_;
 
312
      my ($self, $parms, $args) = @_;
290
313
      #do your thing!
291
314
  }
292
315