home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / TestTieBucketBrigade.pm < prev    next >
Encoding:
Perl POD Document  |  2004-02-16  |  1.7 KB  |  82 lines

  1. package Apache::TestTieBucketBrigade;
  2.  
  3. use 5.006001;
  4.  
  5. use strict;
  6. use warnings FATAL => 'all';
  7.  
  8. use Apache::Connection ();
  9. use APR::Bucket ();
  10. use APR::Brigade ();
  11. use APR::Util ();
  12. use Apache::Const -compile => qw(OK);
  13. use Apache::TieBucketBrigade;
  14.  
  15. our $VERSION = '0.02';
  16.  
  17. sub handler {
  18.     my $c = shift;
  19.     my $FH = Apache::TieBucketBrigade->new_tie($c);
  20.     my @stuff = <$FH>;
  21.     print $FH uc( join '', @stuff );
  22.     Apache::OK;
  23. }
  24.  
  25. 1;
  26. __END__
  27.  
  28. =head1 NAME
  29.  
  30. Apache::TestTieBucketBrigade - Tests Apache::TieBucketBrigade takes a bunch of
  31. stuff in then writes it back upcased
  32.  
  33. =head1 SYNOPSIS
  34.  
  35. unh - read the code
  36.  
  37. =head1 DESCRIPTION
  38.  
  39. It tests stuff.  I suppose you could use it as an example of building things
  40. with Apache::TieBucketBrigade.  This would be cooler if I actually new how
  41. to test mod_perl protocol handlers.  For now, put something like the following
  42. in httpd.conf
  43.  
  44. Listen localhost:8013
  45.  
  46. <VirtualHost localhost:8013>
  47.  
  48.       PerlModule                   Apache::TestTieBucketBrigade
  49.       PerlProcessConnectionHandler Apache::TestTieBucketBrigade
  50.  
  51. </VirtualHost>
  52.  
  53. restart apache and hope for the best.  Telnet to locahost:8013 type some stuff
  54. in and see if it comes back upcased.
  55.  
  56. =head2 EXPORT
  57.  
  58. None
  59.  
  60.  
  61. =head1 SEE ALSO
  62.  
  63. Apache::TieBucketBrigade
  64. IO::Stringy
  65. mod_perl
  66. IO::Handle
  67.  
  68. =head1 AUTHOR
  69.  
  70. mock E<lt>mock@obscurity.orgE<gt>
  71.  
  72. =head1 COPYRIGHT AND LICENSE
  73.  
  74. Copyright (C) 2004 by Will Whittaker and Ken Simpson
  75.  
  76. This library is free software; you can redistribute it and/or modify
  77. it under the same terms as Perl itself, either Perl version 5.8.2 or,
  78. at your option, any later version of Perl 5 you may have available.
  79.  
  80.  
  81. =cut
  82.