| 1 | # | ||
| 2 | # This file is part of WebDyne. | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | # Full license text is available at: | ||
| 10 | # | ||
| 11 | # <http://dev.perl.org/licenses/> | ||
| 12 | # | ||
| 13 | package WebDyne::Handler; | ||
| 14 | |||
| 15 | |||
| 16 | # Compiler Pragma | ||
| 17 | # | ||
| 18 | use strict qw(vars); | ||
| 19 | use vars qw($VERSION); | ||
| 20 | use warnings; | ||
| 21 | no warnings qw(uninitialized); | ||
| 22 | |||
| 23 | |||
| 24 | # WebDyne Modules. | ||
| 25 | # | ||
| 26 | use WebDyne::Constant; | ||
| 27 | use WebDyne::Util; | ||
| 28 | |||
| 29 | |||
| 30 | # Version information | ||
| 31 | # | ||
| 32 | $VERSION='3.029'; | ||
| 33 | |||
| 34 | |||
| 35 | # Debug | ||
| 36 | # | ||
| 37 | 0 && debug("%s loaded, version $VERSION", __PACKAGE__); | ||
| 38 | |||
| 39 | |||
| 40 | # And done | ||
| 41 | # | ||
| 42 | 1; | ||
| 43 | |||
| 44 | #------------------------------------------------------------------------------ | ||
| 45 | |||
| 46 | |||
| 47 | sub import { | ||
| 48 | |||
| 49 | |||
| 50 | # Will only work if called from within a __PERL__ block in WebDyne | ||
| 51 | # | ||
| 52 | my ($class, @param)=@_; | ||
| 53 | my $self_cr=UNIVERSAL::can(scalar caller, 'self') || return; | ||
| 54 | my $self=$self_cr->() || return; | ||
| 55 | my %param=(@param == 1) ? (handler => @param) : @param; | ||
| 56 | $self->set_handler($param{'handler'}); | ||
| 57 | |||
| 58 | } | ||
| 59 | __END__ |