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 / ResLoader.pm < prev    next >
Encoding:
Perl POD Document  |  2003-11-21  |  2.2 KB  |  70 lines

  1. package POE::API::ResLoader;
  2.  
  3. use vars qw($VERSION);
  4. $VERSION = do {my@r=(q$Revision: 1.3 $=~/\d+/g);sprintf"%d."."%04d"x$#r,@r};
  5.  
  6. sub import {
  7.     my $package = (caller())[0];
  8.     my $self = shift;
  9.     if(@_) {
  10.         my $initializer = shift;
  11.         if(ref $initializer eq 'CODE') {
  12.             $initializer->();
  13.         }
  14.     }
  15. }
  16.  
  17. =head1 NAME
  18.  
  19. POE::API::ResLoader - provides initalization interface for POE::Resources
  20.  
  21. =head1 SYNOPSIS
  22.  
  23.     use POE::API::ResLoader \&initialize;
  24.  
  25.     sub initialize {
  26.         # do stuff here ...
  27.     }
  28.  
  29. =head1 DESCRIPTION
  30.  
  31. POE::Resource modules needed a uniform standard way of doing stuff 
  32. whenever they are loaded. This module provides that interface. 
  33.  
  34. On C<use>, this module will run the subroutine reference passed in to it. This
  35. subroutine can do anything it deems necessary. 
  36.  
  37. =head1 AUTHOR
  38.  
  39. Matt Cashner (eek+cpan@eekeek.org)
  40.  
  41. =head1 LICENSE
  42.  
  43. Copyright (c) 2003, Matt Cashner
  44.  
  45. Permission is hereby granted, free of charge, to any person obtaining 
  46. a copy of this software and associated documentation files (the 
  47. "Software"), to deal in the Software without restriction, including 
  48. without limitation the rights to use, copy, modify, merge, publish, 
  49. distribute, sublicense, and/or sell copies of the Software, and to 
  50. permit persons to whom the Software is furnished to do so, subject 
  51. to the following conditions:
  52.  
  53. The above copyright notice and this permission notice shall be included 
  54. in all copies or substantial portions of the Software.
  55.  
  56. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  57. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  58. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  59. EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  60. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  61. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  62. OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  63. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  64. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  65. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  66.  
  67. =cut
  68.  
  69. 1;
  70.