File: Control.pm

package info (click to toggle)
librunapp-perl 0.13-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 232 kB
  • sloc: perl: 2,521; makefile: 2
file content (51 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package RunApp::Control;
use strict;
use base qw(RunApp::Base);

AUTOLOAD {
  our $AUTOLOAD;
  my ($cmd) = $AUTOLOAD =~ m/:?(\w+)$/;
  return unless $cmd =~ m/[a-z]/;
  my $self = shift;
  $self->dispatch ($cmd, @_);
}

# abstract
sub dispatch {
    die "This must be implemented by child.";
}

=head1 NAME

RunApp::Control - Control class for RunApp

=head1 SYNOPSIS

 use base 'RunApp::Control'

=head1 DESCRIPTION

The class is not intended for direct use.  It provides a C<AUTOLOAD>
function that delegates calls to the C<dispatch> method.

=head1 SEE ALSO

L<RunApp>

=head1 AUTHORS

Chia-liang Kao <clkao@clkao.org>

Refactored from works by Leon Brocard E<lt>acme@astray.comE<gt> and
Tom Insam E<lt>tinsam@fotango.comE<gt>.

=head1 COPYRIGHT

Copyright (C) 2002-5, Fotango Ltd.

This module is free software; you can redistribute it or modify it
under the same terms as Perl itself.

=cut

1;