Perl-Schnippsel
use String::Random;
my $pw = String::Random::random_string('10101022',[split //,uc 'aei'],[split //,uc 'bdfghklmnprstwxz'],[split //,'23456789']);
Perl
#!/usr/bin/perl
use 5.008;
use strict;
use warnings;
delete @ENV{ qw(ENV BASH_ENV IFS PATH) }; # make safe!
sub main {
# Code
1;
}
main();
1;
__DATA__
__END__
Perl-Modul
#!/usr/bin/perl
package MyPackage;
use 5.008;
use strict;
use warnings;
#Date: 20xx-xx-xx
BEGIN {
our ( $VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS );
# set the version for version checking
# if using RCS/CVS, this may be preferred
$VERSION = do { my @r = ( q$Revision: 0.01 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; # must be all one line, for MakeMaker
use Exporter ();
@ISA = qw(Exporter);
@EXPORT = qw();
%EXPORT_TAGS = qw(); # eg: TAG => [ qw!name1 name2! ],
# optionally exported functions
@EXPORT_OK = qw();
}
use Carp;
our $NAME = __PACKAGE__;
our $COPYRIGHT = q{(c) 2009 by /GwenDragon/};
sub new {
my $class = shift;
my $self = {};
my @options = @_;
bless $self, $class;
$self->initialize( @options );
return $self;
}
sub __initialize {
my $self = shift;
my %options = @_;
for my $k ( keys %options ) {
if ( $self->can( $k ) ) { # is option member of object?
$self->$k( $options{ $k } ); # set option with accessor
}
else {
warn qq(Unknown option for object $NAME);
}
}
return 1;
}
sub AUTOLOAD {
my $self = shift;
my ( $package, $method ) = our $AUTOLOAD =~ /^([\w\:]+)\:\:(\w+)$/;
croak qq(Undefined subroutine/method &${package}::$method called);
}
DESTROY {
}
1;
=head1 NAME
MyPackage - My Perl Module for AnyThing
=head1 VERSION
0.01
=head1 SYNOPSIS
use MyPackage;
my $m = MyPackage->new();
1;
=head1 DESCRIPTION
This module makes this or that!
=head1 EXPORT
None by default.
=head1 METHODS/FUNCTIONS
some_methods();
=head1 SEE ALSO
Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
=head1 SUPPORT
See my website; don't hesitate to contact me for wishes.
=head1 BUGS
None known. But don't hesitate to contact me for bug fixing.
=head1 AUTHOR
GwenDragon, E<lt>dev@gwendragon.deE<gt>, L<http://labs.gwendragon.de/>
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2012 by I<GwenDragon>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8 or,
at your option, any later version of Perl 5 you may have available.
=cut
HTML5
<html>
<head>
</head>
<body>
<article>
<h1>Perl! WTF?</h1>
<p>Perl ist toll!</p>
</article>
</html>