Farid Hajji: Perl - Einführung, Anwendungen, Referenz
2., aktualisierte und erweiterte Auflage
Addison-Wesley Longman, ISBN 3-8273-1535-2
ST/Beam/Beam.pm
package ST::Beam;
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
@ISA = qw(Exporter AutoLoader);
# Hier stehen die Funktionen, die in den Namensraum des
# Aufrufers unbedingt (@EXPORT) oder bedingt (@EXPORT_OK)
# exportiert werden sollen.
@EXPORT = qw(beam_me_up beam_me_down);
@EXPORT_OK = qw(reverse_beaming check_transporter config_biofilter);
$VERSION = '0.01'; # Okay, fangen wir hier mit 0.01 an!
# Jede neue Version bekommt eine neue
# Versionsnummer.
# Hier ist unsere oeffentliche Schnittstelle
sub beam_me_up { print "beaming back... done!\n"; }
sub beam_me_down { print "hold your breath... done!\n";}
sub reverse_beaming { print "breaking... turn around... back!\n"; }
sub check_transporter { print "can't find any bug, cap'tin!\n"; }
sub config_biofilter {
my $bio = _load_config();
_proceed_config($bio);
_save_config($bio);
_activate_config($bio);
}
# Das sind nur oeffentliche Funktionen, die jedoch nicht in
# den Namensraum des Aufrufers exportiert werden sollen.
sub schwarzian_transform {
print "(map 'extract (sort 'by-dna (map 'combine cells)))\n";
}
# Das sind schliesslich private Hilfsfunktionen, die nicht vom
# aufrufenden Programm aufgerufen werden _sollten_. Dies wird
# durch den vorangestellten Unterstrich angedeutet
sub _load_config { print "loading config...\n"; return "config"; }
sub _save_config { print "saving config: ", shift(), "\n"; }
sub _proceed_config { my $cfg = shift; print "crunching $cfg...\n"; }
sub _activate_config { print "activating ", shift(), "\n" }
1;
__END__
# Das ist die Dokumentation des ST::Beam-Moduls
=head1 NAME
ST::Beam - Perl Access to Starfleet Teleporters
=head1 SYNOPSIS
use ST::Beam;
use ST::Beam qw(reverse_beaming check_transporter
config_biofilter);
beam_me_down(); # Send me to a planet
beam_me_up(); # Beam me up, Scotty!
reverse_beaming(); # In case of emergency
check_transporter(); # What Scotty really hates
config_biofilter(); # Filter out all human DNA
ST::Beam::schwarzian_transform(); # Too scary...
# Don't try at home!
=head1 DESCRIPTION
This Perl module talks directly to the SNMP port of Starfleet
vessel teleporters. You can now request a teleport from your
hypercube laptop with just a few lines of perl.
=head1 EXAMPLES
Selfexplanatory. If you don't understand this, consult the engineering
hotline under eng-hotline@<your ship name here>
=head1 SEE ALSO
perl(1), ST::Beam::Tractor(3), ST::WarpEngine(3), ST::TurboLift(3),
Request for Comments RFC 97343 Starfleet Teleport SNMP MIB.
=head1 BUGS
The Starfleet Teleport SNMP MIB is a little buggy.
You risk under some weird situations a personality split. See
also records about Cpt. Jim T. Kirk, USS 1701 and LtCmdr.
William Riker, USS 1701-D.
=head1 AUTHOR
Farid Hajji <farid.hajji@ob.kamp.net>
=cut
[Prev] [Up] [Relevant Chapter] [Next]
[Alte Quelle]
| Last modified: $Date: 2006/05/18 12:56:12 $ FH. Search :: Sitemap :: Disclaimer :: Copyright :: Privacy |
|