view release on metacpan or search on metacpan
local/lib/perl5/IO/Async/Socket.pm view on Meta::CPAN
},
);
$loop->add( $socket );
$socket->connect(
host => "some.host.here",
service => "echo",
socktype => 'dgram',
)->get;
$socket->send( "A TEST DATAGRAM" );
$loop->run;
=head1 DESCRIPTION
This subclass of L<IO::Async::Handle> contains a socket filehandle. It
provides a queue of outgoing data. It invokes the C<on_recv> handler when new
data is received from the filehandle. Data may be sent to the filehandle by
calling the C<send> method.
local/lib/perl5/IO/Async/Stream.pm view on Meta::CPAN
Consider the following protocol (inspired by IMAP), which consists of
C<\n>-terminated lines that may have an optional data block attached. The
presence of such a data block, as well as its size, is indicated by the line
prefix.
sub on_read
{
my $self = shift;
my ( $buffref, $eof ) = @_;
if( $$buffref =~ s/^DATA (\d+):(.*)\n// ) {
my $length = $1;
my $line = $2;
return sub {
my $self = shift;
my ( $buffref, $eof ) = @_;
return 0 unless length $$buffref >= $length;
# Take and remove the data from the buffer
local/lib/perl5/Module/Build.pm view on Meta::CPAN
=back
=head2 Default Options File (F<.modulebuildrc>)
[version 0.28]
When Module::Build starts up, it will look first for a file,
F<$ENV{HOME}/.modulebuildrc>. If it's not found there, it will look
in the F<.modulebuildrc> file in the directories referred to by
the environment variables C<HOMEDRIVE> + C<HOMEDIR>, C<USERPROFILE>,
C<APPDATA>, C<WINDIR>, C<SYS$LOGIN>. If the file exists, the options
specified there will be used as defaults, as if they were typed on the
command line. The defaults can be overridden by specifying new values
on the command line.
The action name must come at the beginning of the line, followed by any
amount of whitespace and then the options. Options are given the same
as they would be on the command line. They can be separated by any
amount of whitespace, including newlines, as long there is whitespace at
the beginning of each continued line. Anything following a hash mark (C<#>)
is considered a comment, and is stripped before parsing. If more than
local/lib/perl5/Module/Build/API.pod view on Meta::CPAN
Also see the C<create_license> parameter.
=item meta_add
[version 0.28]
A hash of key/value pairs that should be added to the F<META.yml> file
during the C<distmeta> action. Any existing entries with the same
names will be overridden.
See the L</"MODULE METADATA"> section for details.
=item meta_merge
[version 0.28]
A hash of key/value pairs that should be merged into the F<META.yml>
file during the C<distmeta> action. Any existing entries with the
same names will be overridden.
The only difference between C<meta_add> and C<meta_merge> is their
behavior on hash-valued and array-valued entries: C<meta_add> will
completely blow away the existing hash or array value, but
C<meta_merge> will merge the supplied data into the existing hash or
array value.
See the L</"MODULE METADATA"> section for details.
=item module_name
[version 0.03]
The C<module_name> is a shortcut for setting default values of
C<dist_name> and C<dist_version_from>, reflecting the fact that the
majority of CPAN distributions are centered around one "main" module.
For instance, if you set C<module_name> to C<Foo::Bar>, then
C<dist_name> will default to C<Foo-Bar> and C<dist_version_from> will
local/lib/perl5/Module/Build/API.pod view on Meta::CPAN
=item use_rcfile()
=item use_tap_harness()
=item verbose()
=item xs_files()
=back
=head1 MODULE METADATA
If you would like to add other useful metadata, C<Module::Build>
supports this with the C<meta_add> and C<meta_merge> arguments to
L</new()>. The authoritative list of supported metadata can be found at
L<CPAN::Meta::Spec> but for convenience - here are a few of the more useful ones:
=over 4
=item keywords
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
unless (magic_number_matches()) {
die ("Configuration seems to be out of date, please re-run 'perl Build.PL' again.\\n");
}
}
unshift \@INC,
(
$quoted_INC
);
}
close(*DATA) unless eof(*DATA); # ensure no open handles to this script
use $build_package;
Module::Build->VERSION(q{$config_requires});
# Some platforms have problems setting \$^X in shebang contexts, fix it up here
\$^X = Module::Build->find_perl_interpreter;
if (-e 'Build.PL' and not $build_package->up_to_date('Build.PL', \$progname)) {
warn "Warning: Build.PL has been altered. You may need to run 'perl Build.PL' again.\\n";
}
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
}
# Look for a home directory on various systems.
sub _home_dir {
my @home_dirs;
push( @home_dirs, $ENV{HOME} ) if $ENV{HOME};
push( @home_dirs, File::Spec->catpath($ENV{HOMEDRIVE}, $ENV{HOMEPATH}, '') )
if $ENV{HOMEDRIVE} && $ENV{HOMEPATH};
my @other_home_envs = qw( USERPROFILE APPDATA WINDIR SYS$LOGIN );
push( @home_dirs, map $ENV{$_}, grep $ENV{$_}, @other_home_envs );
my @real_home_dirs = grep -d, @home_dirs;
return wantarray ? @real_home_dirs : shift( @real_home_dirs );
}
sub _find_user_config {
my $self = shift;
my $file = shift;
local/lib/perl5/Module/Build/ConfigData.pm view on Meta::CPAN
package Module::Build::ConfigData;
use strict;
my $arrayref = eval do {local $/; <DATA>}
or die "Couldn't load ConfigData data: $@";
close DATA;
my ($config, $features, $auto_features) = @$arrayref;
sub config { $config->{$_[1]} }
sub set_config { $config->{$_[1]} = $_[2] }
sub set_feature { $features->{$_[1]} = 0+!!$_[2] } # Constrain to 1 or 0
sub auto_feature_names { sort grep !exists $features->{$_}, keys %$auto_features }
sub feature_names {
local/lib/perl5/Module/Build/ConfigData.pm view on Meta::CPAN
# Can't use Module::Build::Dumper here because M::B is only a
# build-time prereq of this module
require Data::Dumper;
my $mode_orig = (stat $me)[2] & 07777;
chmod($mode_orig | 0222, $me); # Make it writeable
open(my $fh, '+<', $me) or die "Can't rewrite $me: $!";
seek($fh, 0, 0);
while (<$fh>) {
last if /^__DATA__$/;
}
die "Couldn't find __DATA__ token in $me" if eof($fh);
seek($fh, tell($fh), 0);
my $data = [$config, $features, $auto_features];
print($fh 'do{ my '
. Data::Dumper->new([$data],['x'])->Purity(1)->Dump()
. '$x; }' );
truncate($fh, tell($fh));
close $fh;
chmod($mode_orig, $me)
local/lib/perl5/Module/Build/ConfigData.pm view on Meta::CPAN
=head1 AUTHOR
C<Module::Build::ConfigData> was automatically created using C<Module::Build>.
C<Module::Build> was written by Ken Williams, but he holds no
authorship claim or copyright claim to the contents of C<Module::Build::ConfigData>.
=cut
__DATA__
do{ my $x = [
{},
{},
{
'HTML_support' => {
'description' => 'Create HTML documentation',
'requires' => {
'Pod::Html' => 0
}
},
local/lib/perl5/Module/Build/Notes.pm view on Meta::CPAN
}
sub _dump {
my ($self, $file, $data) = @_;
open(my $fh, '>', $file) or die "Can't create '$file': $!";
print {$fh} Module::Build::Dumper->_data_dump($data);
close $fh;
}
my $orig_template = do { local $/; <DATA> };
close DATA;
sub write_config_data {
my ($self, %args) = @_;
my $template = $orig_template;
$template =~ s/NOTES_NAME/$args{config_module}/g;
$template =~ s/MODULE_NAME/$args{module}/g;
$template =~ s/=begin private\n//;
$template =~ s/=end private/=cut/;
# strip out private POD markers we use to keep pod from being
# recognized for *this* source file
$template =~ s{$_\n}{} for '=begin private', '=end private';
open(my $fh, '>', $args{file}) or die "Can't create '$args{file}': $!";
print {$fh} $template;
print {$fh} "\n__DATA__\n";
print {$fh} Module::Build::Dumper->_data_dump([$args{config_data}, $args{feature}, $args{auto_features}]);
close $fh;
}
1;
=head1 NAME
Module::Build::Notes - Create persistent distribution configuration modules
local/lib/perl5/Module/Build/Notes.pm view on Meta::CPAN
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 SEE ALSO
perl(1), L<Module::Build>(3)
=cut
__DATA__
package NOTES_NAME;
use strict;
my $arrayref = eval do {local $/; <DATA>}
or die "Couldn't load ConfigData data: $@";
close DATA;
my ($config, $features, $auto_features) = @$arrayref;
sub config { $config->{$_[1]} }
sub set_config { $config->{$_[1]} = $_[2] }
sub set_feature { $features->{$_[1]} = 0+!!$_[2] } # Constrain to 1 or 0
sub auto_feature_names { sort grep !exists $features->{$_}, keys %$auto_features }
sub feature_names {
local/lib/perl5/Module/Build/Notes.pm view on Meta::CPAN
# Can't use Module::Build::Dumper here because M::B is only a
# build-time prereq of this module
require Data::Dumper;
my $mode_orig = (stat $me)[2] & 07777;
chmod($mode_orig | 0222, $me); # Make it writeable
open(my $fh, '+<', $me) or die "Can't rewrite $me: $!";
seek($fh, 0, 0);
while (<$fh>) {
last if /^__DATA__$/;
}
die "Couldn't find __DATA__ token in $me" if eof($fh);
seek($fh, tell($fh), 0);
my $data = [$config, $features, $auto_features];
print($fh 'do{ my '
. Data::Dumper->new([$data],['x'])->Purity(1)->Dump()
. '$x; }' );
truncate($fh, tell($fh));
close $fh;
chmod($mode_orig, $me)