view release on metacpan or search on metacpan
examples/ipsfss_receive.pl view on Meta::CPAN
use bytes;
use Net::Pcap qw( loop );
use Acme::RFC4824;
sub process_packet {
my ($user_data, $header, $packet) = @_;
# assuming the packet is ethernet
my $packet_type = unpack('H*', substr($packet, 12, 2));
if ($packet_type ne '0800') {
# not an IP packet, ignore it
examples/ipsfss_receive.pl view on Meta::CPAN
die "Can not compile filter '$filter_str'";
}
Net::Pcap::setfilter($pcap, $filter);
my $user_data;
loop($pcap, -1, \&process_packet, $user_data);
exit 1;
view all matches for this distribution
view release on metacpan or search on metacpan
Exit from the program immediately! Otherwise it will be killed forcefully.
=over 4
=head2 process_lines
=back
This is the method that reads (if it can) from the server and execute
the apropiate method. You can manage yourself, or let the module to
$actions{$key} = $code;
}
}
###
sub process_lines
{
my $self = shift;
while(my @l = $select->can_read(0.1))
{
my $hd = $l[0];
sub Start
{
my $self = shift;
while(1)
{
$self->process_lines;
sleep 1;
}
}
sub Log
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
open FH, "> $_[0]" or die "open($_[0]): $!";
foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
$s =~ s/^(\d+)\.?//;
view all matches for this distribution
view release on metacpan or search on metacpan
t/pms/RayApp.pm view on Meta::CPAN
=head1 INTRODUCTION
The B<RayApp> provides a framework for data-centric Web applications.
Instead of writing Perl code that prints HTML, or a code that calls
functions that print HTML, or embedding the code inside of HTML
markup, the Web applications only process and return Perl data.
No markup handling is done in the code of individual applications,
thus application code can focus on the business logic. This reduces
the presentation noise in individual applications, increases
maintainability and speeds development.
The data returned by the application is then serialized to XML and
can be postprocessed by XSLT to desired output format, which may be
HTML, XHTML, WML or anything else. In order to provide all parties
involved (analysts, application programmers, Web designers, ...) with
a common specification of the data format, data structure description
(DSD) file is a mandatory part of the applications. The DSD describes
what parameters the application expects and what data it will return,
t/pms/RayApp.pm view on Meta::CPAN
by the application in a form of hash by the Perl code is fitted into
the data structure, creating XML file with agreed-on elements.
This way, application programmers know what data is expected from
their applications and Web designers know what XMLs the
prostprocessing stage will be dealing with, in advance. In addition,
application code can be tested separately from the presentation part,
and tests for both application and presentation part can be written
independently, in parallel. Of course, this also works if you are the
sole person on the project, playing the above mentioned roles.
t/pms/RayApp.pm view on Meta::CPAN
in a B<package> context in a B<Apache::Registry> manner, so two
B<handler> methods from different applications do not clash. In
app.xsl, there should be an XSLT stylesheet.
If you issue a request for /sub/app.xml, the presentation
postprocessing is skipped and you get the XML output -- ideal for
debugging.
If the app.html file exists in the filesystem, it "overrides" any
attempts to is generate dynamic content, and the file is returned.
Likewise, if there is a app.xml file in the filesystem and there is
a request for app.xml, the XML file is returned. If there is app.xml
but no app.html and a request for app.html comes, the app.xml is
serialized using app.xsl. So B<RayApp> can be used not only for fully
dynamic sites, but also as a XSLT processor.
You will need to configure Apache for B<RayApp> to do its job. It
can operate both in the mod_perl and in pure CGI way.
=head2 Pure mod_perl approach
t/pms/RayApp.pm view on Meta::CPAN
<Location /sub>
SetEnv RAYAPP_DIRECTORY /opt/www
</Location>
With the B<ScriptAliasMatch> directive in effect, the request will
be processed by B<usr/bin/rayapp_cgi_wrapper>, and the
C<SetEnv RAYAPP_DIRECTORY> tells B<RayApp> where on the filesystem
should it find the necessary files of the application (the same
as B<Alias> with mod_perl setup).
Here we partly simulate the work that Apache would have done for us
in the static files case.
t/pms/RayApp.pm view on Meta::CPAN
B<handler>.
=item RayAppStyleParamModule / RAYAPP_STYLE_PARAM_MODULE
There are often additional data except the core data of the
application that you might like to process in your XSLT
stylesheets -- id of the authenticated user, the full and
relative URLs of the currently running application, some sticky
preferences of the user. They are more related to the presentation
than to the business logic of the application, so you do not want to
have them in your DSD and have all your applications generate them and
return them.
The option B<RayAppStyleParamModule> specifies a module name from
which a B<handler> function will be called for every request that goes
to the postprocessing stage. It will be passed the DSD object and the
same arguments as the application B<handler> (those returned by
B<RayAppInputModule>) and it should return a list of key => value
pairs that will be passed to the stylesheet.
A simple style parameter module might look like this:
t/pms/RayApp.pm view on Meta::CPAN
<xsl:value-of select="$my_relative_url"/>
=item RayAppStyleStaticParams / RAYAPP_STYLE_STATIC_PARAMS
When a static .xml file is processed into HTML, the XSL
transformation is run, even if there was no application invocation
in the process. Normally, the B<handler> of module specified by
B<RayAppInputModule> would not be run in this case. If you want the
module to be run even in this case (thus generating input argument for
the B<RayAppStyleParamModule> module), set this option to true.
=head2 The applications
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RunDoc.pm view on Meta::CPAN
Acme::RunDoc->do("helloworld.doc");
=head1 DESCRIPTION
It is recieved wisdom that word processors are better than text editors.
After all, you can style your documents with different fonts and colours;
you can take advantage of the built-in spell check; and your ugly single
and double quote characters get auto-replaced with "smart" curly versions.
This module allows you to run Perl documents edited in Microsoft Word
(and other word processors capable of saving in the ".doc" format) as
normal Perl code. You can write scripts and run them like this:
perl -Microsoft::Word helloworld.doc
or call them from other files using:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/SexualReproduction.pm view on Meta::CPAN
our $VERSION = '0.01';
=head1 SYNOPSIS
This module allows you to improve the chances of your program kind to survive by mixing genes of their processes when creating a child process. Especially if your program is a K-strategic one.
In a "female" process:
use Acme::SexualReproduction 'female';
my $pid = female('unique ID', \%chromosomes);
...
In a "male" process:
use Acme::SexualReproduction 'male';
male('unique ID', \%chromosomes);
The child is spawned then from the female process.
=head1 EXPORT
Only two functions are exported: one for insemination (a "male" process) and one for allocating a shared hash of chromosomes and spawning a child (a "female" process).
=head2 male($id, \%chromosomes);
Tries to write the chromosomes to the shared memory of the female process with unique SHM $id. Sadly, does not return the child's PID.
=cut
=for comment
This subroutine was written first just because it was easier. I strongly disclaim any sexual discrimination from my side. It's written just for fun anyways.
=cut
sub male {
my ($id, $chromosomes) = @_;
croak "\$chromosomes must be a HASH reference" unless ref $chromosomes eq 'HASH';
croak "Male process is sterile" unless keys %$chromosomes;
tie my $sperm, 'IPC::Shareable', { key => $id } || croak "Couldn't copulate with female process, SHM ID $id: $!";
(tied $sperm)->shlock;
@{$sperm}{keys %$chromosomes} = values %$chromosomes;
(tied $sperm)->shunlock;
return 1;
}
=head2 $pid = female($id, \%chromosomes)
Shares a hash for the male process' chromosomes, waits for the insemination, mixes the genes and spawns the child process. \%chromosomes hash reference is changed in the child process.
=cut
sub female {
my ($id, $chromosomes) = @_;
croak "\$chromosomes must be a HASH reference" unless ref $chromosomes eq 'HASH';
tie my $sperm, 'IPC::Shareable', {key => $id, create => 1 } or carp("Couldn't copulate with male process: $!"), return;
sleep 0.5 while !keys %$sperm; # foreplay
keys %$sperm eq keys %$chromosomes or carp("Chromosome mismatch"), return;
my %child_chromosomes = map { $_, int rand 2 ? $chromosomes->{$_} : $sperm->{$_} } keys %$chromosomes;
my $pid = fork;
carp("Couldn't spawn a child: $!"), return unless defined $pid;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Win32.pm view on Meta::CPAN
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Sort/Bogosort.pm view on Meta::CPAN
a sorted result in the average case. However, there is no guarantee that any particular sort
will come in anywhere near average.
Keep in mind that a list of five items consumes an average of 5!, or 120 iterations. 10! is
3,628,800 shuffles. Also keep in mind that each shuffle itself is an O(n-1) operation.
Unless you need to heat a cold office with your processor avoid sorts on large data sets.
=head1 EXPORT
Always exports one function: C<bogosort()>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Sort/Bozo.pm view on Meta::CPAN
36,288,000 iterations on average. The universe will either collapse or expand to the point that it cannot sustain
life long before the Bozo sort manages to sort a deck of cards, in the average case. In the worst case, all of the
background radiation from our universe will have decayed to the point that there is no longer any trace of our
existence before this sort manages to alphabetically sort your social networking friends list.
Test with short (4 to 7 element) lists, and be prepared to kill the process if you mistakenly hand it more elements
than that.
=head1 EXPORT
Always exports one function: C<bozo()>.
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/IO/Async.pm view on Meta::CPAN
An L<IO::Async::Handle> object is a Notifier that represents a single IO handle
being managed. While in most cases it will represent a single filehandle, such
as a socket (for example, an L<IO::Socket::INET> connection), it is possible
to have separate reading and writing handles (most likely for a program's
C<STDIN> and C<STDOUT> streams, or a pair of pipes connected to a child
process).
The L<IO::Async::Stream> class is a subclass of L<IO::Async::Handle> which
maintains internal incoming and outgoing data buffers. In this way, it
implements bidirectional buffering of a byte stream, such as a TCP socket. The
class automatically handles reading of incoming data into the incoming buffer,
local/lib/perl5/IO/Async.pm view on Meta::CPAN
installed.
=head2 Signals
An L<IO::Async::Signal> object represents a POSIX signal, which will invoke a
callback when the given signal is received by the process. Multiple objects
watching the same signal can be used; they will all invoke in no particular
order.
=head2 Processes Management
An L<IO::Async::PID> object invokes its event when a given child process
exits. An L<IO::Async::Process> object can start a new child process running
either a given block of code, or executing a given command, set up pipes on
its filehandles, write to or read from these pipes, and invoke its event when
the child process exits.
=head2 Loops
The L<IO::Async::Loop> object class represents an abstract collection of
L<IO::Async::Notifier> objects, and manages the actual filehandle IO
local/lib/perl5/IO/Async.pm view on Meta::CPAN
implementation exists for the specific OS it runs on.
=head2 Child Processes
The L<IO::Async::Loop> object provides a number of methods to facilitate the
running of child processes. C<spawn_child> is primarily a wrapper around the
typical C<fork(2)>/C<exec(2)> style of starting child processes, and
C<run_child> provide a method similar to perl's C<readpipe> (which is used
to implement backticks C<``>).
=head2 File Change Watches
local/lib/perl5/IO/Async.pm view on Meta::CPAN
=head2 Asynchronous Co-routines and Functions
The C<IO::Async> framework generally provides mechanisms for multiplexing IO
tasks between different handles, so there aren't many occasions when it is
necessary to run code in another thread or process. Two cases where this does
become useful are when:
=over 4
=item *
local/lib/perl5/IO/Async.pm view on Meta::CPAN
no asynchronous version is supplied.
=back
For these cases, an instance of L<IO::Async::Function> can be used around
a code block, to execute it in a worker child process or set of processes.
The code in the sub-process runs isolated from the main program, communicating
only by function call arguments and return values. This can be used to solve
problems involving state-less library functions.
An L<IO::Async::Routine> object wraps a code block running in a separate
process to form a kind of co-routine. Communication with it happens via
L<IO::Async::Channel> objects. It can be used to solve any sort of problem
involving keeping a possibly-stateful co-routine running alongside the rest of
an asynchronous program.
=head2 Futures
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Spork.pm view on Meta::CPAN
close $log_fh;
},
) or die qq{Couldn't fork for spork: $!};
print 2;
This prints out "12" immediately and is done running, now if you tail -f spork.log you'll see "I am spork hear me spoon\n" get written to it 4 or 5 seconds later by the spork()ed process :)
spork() returns the PID of the spork()ed process so you can keep track of them and do what you need with it.
If it returns false then fork failed so you can:
if(spork(\&foo)) {
print "I am spork here me spoon\n";
lib/Acme/Spork.pm view on Meta::CPAN
It will use your setsid() instead and POSIX will not be brought in. If it doesn't actually setsid() then you just broke yourself so don't do that.
=head1 daemonize()
Since many daemons need to spork a child process when a request is received I've included a cheat function to daemonize your script execution.
Its simply a wrapper for Proc::Daemon::Init.
use Acme::Spork qw(daemonize);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
open FH, "> $_[0]" or die "open($_[0]): $!";
foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!" }
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
$s =~ s/^(\d+)\.?//;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Sub/Parms.pm view on Meta::CPAN
# to provide alternative features.
#
# It takes two parameters:
#
# $raw_spec - this is the content of the [....] block (not including the '[' and ']' block delimitters)
# $field_name - the hash key for the field being processed
#
# As each line of the BindParms block is processed the two parameters for each line are passed to the bind_spec
# method for evaluation. bind_spec should return a string containing any Perl code generated as a result of
# the bind specification.
#
# Good style dictates that the returned output should be *ONE* line (it could be a very *long* line)
# so that line numbering in the source file is preserved for any error messages.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
make test
su
make install
See the INSTALL file for details on the build and installation
process.
For faster testing with multiple CPUs, you can activate parallel processing
with HARNESS_OPTIONS=j<x>. For example, this would run 8 tests in parallel:
make test HARNESS_OPTIONS=j8
Regression Test Options
Testing in a FreeBSD jail
-------------------------
see https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761 for details;
basically, set SPAMD_LOCALHOST to indicate the IP address to use to contact
processes running on the same host, instead of 127.0.0.1.
------------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Win32.pm view on Meta::CPAN
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
100% test coverage
Please refer to 'perldoc Acme::Test' after installation for details.
Acme::Test follows the standard perl module install process
perl Makefile.PL
make
make test
make install
view all matches for this distribution
view release on metacpan or search on metacpan
pregfree2||5.011000|
pregfree|||
prescan_version||5.011004|
printbuf|||
printf_nocontext|||vn
process_special_blocks|||
ptr_hash|||n
ptr_table_clear||5.009005|
ptr_table_fetch||5.009005|
ptr_table_find|||n
ptr_table_free||5.009005|
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Win32.pm view on Meta::CPAN
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Capture/Tiny.pm view on Meta::CPAN
our $TIMEOUT = 30;
#--------------------------------------------------------------------------#
# command to tee output -- the argument is a filename that must
# be opened to signal that the process is ready to receive input.
# This is annoying, but seems to be the best that can be done
# as a simple, portable IPC technique
#--------------------------------------------------------------------------#
my @cmd = ($^X, '-C0', '-e', '$SIG{HUP}=sub{exit}; '
. 'if( my $fn=shift ){ open my $fh, qq{>$fn}; print {$fh} $$; close $fh;} '
t/lib/Capture/Tiny.pm view on Meta::CPAN
stdout => $stash->{old}{$which},
stderr => $stash->{capture}{$which},
};
# flag file is used to signal the child is ready
$stash->{flag_files}{$which} = scalar tmpnam();
# execute @cmd as a separate process
if ( $IS_WIN32 ) {
local $@;
eval "use Win32API::File qw/CloseHandle GetOsFHandle SetHandleInformation fileLastError HANDLE_FLAG_INHERIT INVALID_HANDLE_VALUE/ ";
# _debug( "# Win32API::File loaded\n") unless $@;
my $os_fhandle = GetOsFHandle( $stash->{tee}{$which} );
t/lib/Capture/Tiny.pm view on Meta::CPAN
my $pid = fork;
if ( not defined $pid ) {
Carp::confess "Couldn't fork(): $!";
}
elsif ($pid == 0) { # child
# _debug( "# in child process ...\n" );
untie *STDIN; untie *STDOUT; untie *STDERR;
_close $stash->{tee}{$which};
# _debug( "# redirecting handles in child ...\n" );
_open_std( $stash->{child}{$which} );
# _debug( "# calling exec on command ...\n" );
t/lib/Capture/Tiny.pm view on Meta::CPAN
my $start = time;
my @files = values %{$stash->{flag_files}};
my $timeout = defined $ENV{PERL_CAPTURE_TINY_TIMEOUT}
? $ENV{PERL_CAPTURE_TINY_TIMEOUT} : $TIMEOUT;
1 until _files_exist(@files) || ($timeout && (time - $start > $timeout));
Carp::confess "Timed out waiting for subprocesses to start" if ! _files_exist(@files);
unlink $_ for @files;
}
sub _kill_tees {
my ($stash) = @_;
if ( $IS_WIN32 ) {
# _debug( "# closing handles with CloseHandle\n");
CloseHandle( GetOsFHandle($_) ) for values %{ $stash->{tee} };
# _debug( "# waiting for subprocesses to finish\n");
my $start = time;
1 until wait == -1 || (time - $start > 30);
}
else {
_close $_ for values %{ $stash->{tee} };
t/lib/Capture/Tiny.pm view on Meta::CPAN
_close( $_ ) for values %{$stash->{old}}; # don't leak fds
# shouldn't need relayering originals, but see rt.perl.org #114404
_relayer(\*STDOUT, $layers{stdout}) if $do_stdout;
_relayer(\*STDERR, $layers{stderr}) if $do_stderr;
_unproxy( %proxy_std );
# _debug( "# killing tee subprocesses ...\n" ) if $do_tee;
_kill_tees( $stash ) if $do_tee;
# return captured output, but shortcut in void context
# unless we have to echo output to tied/scalar handles;
my %got;
if ( defined wantarray or ($do_tee && keys %localize) ) {
t/lib/Capture/Tiny.pm view on Meta::CPAN
the duration of the C<<< capture >>> or C<<< tee >>> call and then, for C<<< tee >>>, send captured
output to the output filehandle after the capture is complete. (Requires Perl
5.8)
Capture::Tiny attempts to preserve the semantics of STDIN opened to a scalar
reference, but note that external processes will not be able to read from such
a handle. Capture::Tiny tries to ensure that external processes will read from
the null device instead, but this is not guaranteed.
B<Tied output filehandles>
If STDOUT or STDERR are tied prior to the call to C<<< capture >>> or C<<< tee >>>, then
t/lib/Capture/Tiny.pm view on Meta::CPAN
thing.
B<Tied input filehandle>
Capture::Tiny attempts to preserve the semantics of tied STDIN, but this
requires Perl 5.8 and is not entirely predictable. External processes
will not be able to read from such a handle.
Unless having STDIN tied is crucial, it may be safest to localize STDIN when
capturing:
t/lib/Capture/Tiny.pm view on Meta::CPAN
=head1 ENVIRONMENT
=head2 PERL_CAPTURE_TINY_TIMEOUT
Capture::Tiny uses subprocesses for C<<< tee >>>. By default, Capture::Tiny will
timeout with an error if the subprocesses are not ready to receive data within
30 seconds (or whatever is the value of C<<< $Capture::Tiny::TIMEOUT >>>). An
alternate timeout may be specified by setting the C<<< PERL_CAPTURE_TINY_TIMEOUT >>>
environment variable. Setting it to zero will disable timeouts.
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
use Acme::Tools;
print eval{ md5sum($_)." $_\n" } || $@ for @ARGV;
This sub requires L<Digest::MD5>, which is a core perl-module since
version 5.?.? It does not slurp the files or spawn new processes.
If the input argument is a scalar ref then the MD5 of the string referenced is returned in hex.
=cut
@i[$p-1,$q] = @i[$q,$p-1];
}
$n;
}
#Fischer-Krause permutation starting from a specific sequence, for example to farm out permute to more than one process
sub permute_continue (&\@\@) {
my ($f,$begin,$from) = @_;
my %h; @h{@$begin} = 0 .. $#$begin;
my @idx = @h{@$from};
my $n = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-ToFromUnicode.t view on Meta::CPAN
);
$unify->file_back_to_ascii($dir . '/unifile.txt', $dir . '/output.txt');
my $text2 = read_text($dir . '/output.txt');
is($text2, $text, 'Text files are lossless-ly processed');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Urinal.pm view on Meta::CPAN
=head1 DESCRIPTION
When men use a bathroom with multiple urinals. The way the urinal to use is
chosen is nearly deterministic. This module allocates resources in a way that
emulates this process.
Basically, a L<Acme::Urinal> object keeps track of a list of resources. You can
then request these resources be allocated and used by asking for one using the
L</pick_one> method. It will return the next resource according to the
algorithm. Once finished suing that resource, you may return it using the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/VOYAGEGROUP/ConferenceRoom.pm view on Meta::CPAN
sub conference_room {
my $room_name = shift or croak "Conference Room Not Found";
my $output_type = shift || 'color';
$room_name = _normalize($room_name);
my $process = $PROCESS_OF{$room_name};
croak "Conference Room Not Found: $room_name" unless $process;
croak "Mistake Position: $process->{position}" if $process->{position} !~ m/\s(\^?).+?(\$?)\s/xms;
my @lines = split "\n", FLOOR_PLAN;
my($head, $tail) = ($1) ? ('', '/') : ('/', '');
for my $i (@{ $process->{lines} }) {
1 while $lines[$i] =~ s{$process->{position}}{$head$1$tail};
}
if ($output_type ne 'none') {
my $module = $OUTPUT_OF{$output_type};
croak "No Type: $output_type" unless $module;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Win32.pm view on Meta::CPAN
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
.
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/WTF.pm $(INST_MAN3DIR)/Acme::WTF.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
view all matches for this distribution