de { $path ~= "\{$mode}" }
my($title, $class)=("(page does not exist)", " broken");
if $path ~~ /\:/ {
$title="External link: $path";
$class=" external";
}
else {
try {
#warn "attempt
if $_ ~~ Str {
my $str=HTML::Entities::encode_entities($_);
our $skip_whitespace_escape;
unless $skip_whitespace_escape {
$str ~~ s:g{\ }{ };
$str ~~ s:g{\ \
}{ };
$str ~~ s:g{\015}{};
$str ~~ s:g{\n}{<br />};
}
take $str;
}
else {
take $self.:process_skel($_, $request);
}
}
}
}
t ];
}
return *@content;
}
my sub quote($str is copy) {
$str ~~ s:g{\\}{\\\\};
$str ~~ s:g{"}{\\"};
$str ~~ s:g{\n}{\\n};
$str ~~ s:g{\015}{\\r};
return qq("$str");
}
=item C<dump>()
Returns
me (" ~ ( map -> $k, $v { qq($k="e($v)) } %.properties.kv ) ~ ")";
for @.children {
if $_ ~~ Str {
take qq( "e($_));
}
else {
take map { " $_" } $_.dump;
}
}
};
de,
concatenated together.
=cut
method text() {
return [~] gather {
for .children {
if $_ ~~ Str {
take $_;
}
else {
take $_.text();
}
}
}
}
=back 4
=head1 SEE ALSO
L<W
# now try to get it processing again
MogileFS::ProcManager->ProcessQueues;
}
}
# given (job, pid), record that this worker is about to die
sub note_pending_death {
my ($job, $pid)
er. The preceding may
also be written:
use Dog-{$^ver ~~ 1.2.1 | 1.3.4}-{$^auth ~~ /:i jrandom/};
use Dog-{$^ver ~~ Any}-{$^auth ~~ /^cpan\:/}
In any event, however you select the module, i
MatchTest
subset MatchTest of Item | Junction;
Used to supply a test to match against. Assume C<~~> will be used against it.
=back
=head1 Function Packages
=head2 Math::Basic
=over
=item a
C<@array>, in order.
If C<@indextests> are provided, only elements whose indices match
C<$index ~~ any(@indextests)> are iterated.
What is returned at each element of the iteration varies with fun
t::grep ( MatchTest $test : *@values )
gather {
for @values -> $x {
take $x if $x ~~ $test;
}
}
}
=item join
our Str multi Array::join ( @values : Str $delimiter )
our
2 { ... }
when want.List { ... }
The C<want> function can be used with smart matching:
if want ~~ List & 2 & Lvalue { ... }
Which means it can also be used in a switch:
given want {
when Li
ctation count is C<Inf>. You shouldn't
actually return an infinite list, however, unless C<< want ~~ Lazy >>.
The opposite of C<Lazy> context is C<Eager> context (the Perl 5 list
context, which alway
ve where => Parametric, value => (1,2,3);
leave Loop, label => 'LINE', $retval;
leave { $_ ~~ Block and $_ !~ Sub } 1,2,3;
leave () <== 1,2,3;
As it currently stands, the parens aren't op
sh()
It returns a string that is the English version of the given language or if nothing is given (or an invalid langauage) then it returns the current source language's name.
my $source
if ($format eq "latex"){print $outputFH $latex->endFile};
}
#only work if the text files are given (not only the alignment files).
sub getSize {
my $alSet = shift;
my ($file,$factor);
my $size;
path);
for =$fh -> $line {
$start = 1 if $line ~~ rx:perl5/^=pod/;
if $start { $expected_output ~= "$line\n" }
$start = 0 if $line ~~ rx:perl5/^=cut/;
}
$fh.close();
$expected_outp
$caller.package;
$package ~~ s/.*\:\://;
%tags{$package}=1;
}
@msg = ["Note: currently"] unless @msg;
if $active eq any('all', keys %tags) {
unless @msg[-1] ~~ /\n$/ {
@msg.push(" at $
method BUILD() {
self.add_handler("PRIVMSG", -> $event {
my $sent_to_a_chan = $event<object> ~~ rx:Perl5/^[#+&]/;
# Only record if the message was sent to a channel.
%!seen{self.nor
te => time,
text => $event<rest>,
} if $sent_to_a_chan;
if $public and $event<rest> ~~ rx:Perl5/^\?seen\s+([^ ]+)/ {
my $reply_to = $sent_to_a_chan ?? $event<object> !! $event<fro
sub infix:«~~» (Item $left, Item $right) is primitive {
if $right.isa(::Rul) {
$right.matcher.($left);
} elsif $right.isa(Str) {
$left eq $right;
}
}
sub infix:«!~» (Item $left, Ite
m $right) is primitive { not $left ~~ $right }
debug;
my $dh = $dir.opendir;
for $dh.readdir -> $node {
next if $node ~~ m:P5/^(?:\.){1,2}$/;
my $abs = catdir( $dir, $node );
unless -d $abs {
= File::Find.new;
$f.wanted_file = sub ( $file, $path, $pathfile ) {
return 1 if $file ~~ m:P5/^.*\.pm$/;
}
$f.dirs = qw/lib/;
my @files = $f.find;
# debug attribute for s
er($match)};
is( $match?1:0, 0, 'booleanify' );
}
}
# <TimToady> ?eval "a\nb" ~~ /^a$$.^^b$/
# "a\nb" ~~ m:P5/(?smx) \A a $ . ^ b \z/
{
my $rule = __PACKAGE__->compile( '^a$$.^^b$' );
$pattern = ($negate) ?? "([^$unsafe])" !! "([$unsafe])";
$string ~~ s:P5:g/$pattern/{ %escapes{$0} || fail_hi($0) }/;
return $string;
}
}
# multi sub uri_unescape ($str is copy) returns Str is export(:DEFAULT) {
# $str ~~ s:P5:g/%([0-9A-Fa-f]{2})/{ chr(:16($0)) }/;
#
# return $str;
# }
multi
$rule_string ~= "{sprintf("%03b",$k)} becomes {+$v}\n";
}
$rule_string ~~ s:g/1/$true/;
$rule_string ~~ s:g/0/$false/;
return $rule_string;
}
}
ber<30>);
is($rule ~~ ::Automata::Cellular::Rule, Bool::True, '$rule object instantiated');
is($rule.rule_number(), 30, '$rule rule_number set correctly');
is($rule.rule ~~ Hash, 1, '$rule.rule
eq ne lt le gt ge
~~ =:= === eqv
!== !~~ !eq !=:= !=== !eqv etc.
tight and &&
tight or
equal to
cmp <=> leg # lt => -1, eq => 0, gt => +1
~~ # smart match (see smartmatch)
!~~ # negated smart match
In general, any infix compar
$?OS eq 'os2' );
&readlink := { undef } if $dosish;
unless ( ( $script ~~ m:P5 [/] || ( $dosish && $script ~~ m:P5 [\\] ) )
&& -f $script )
{
for File::Spec.path(
ate = (+<<@.state[$.steps..(@.state.elems() - $.steps)]).join("");
$state ~~ s:g/0/$false/;
$state ~~ s:g/1/$true/;
"Stage $.stage: $state";
}
multi sub *postfix:<++>