$string;
$result ~~ s:Perl5:g/&\#(\d+);?/{chr($0)}/;
$result ~~ s:Perl5:g/(&\#[xX]([0-9a-fA-F]+);?)/{my $c = :16($1); $c < 256 ?? chr($c) !! $0}/;
$result ~~ s:Perl5:g/(&(\w+);?)/{%en
code\n "
# ) if $!;
#}
#%subst{$unsafe_chars}($string);
$result ~~ s:Perl5:g/([$unsafe_chars])/{
%char_to_entity.exists($0)
?? %char_to_e
}
else {
# Encode control chars, high bit chars and '<', '&', '>', '"'
$result ~~ s:perl5:g/([^\n\r\t !\#\$%\'-;=?-~])/{
%char_to_entity.exists($0)
?? %
difier: sets modifications if $modif, a reference to vector of modification
names or a string is given (see Pheny::InSilico::MassCalculator::variablePeptide function for instance),
returns a reference
difier: sets modifications if $modif, a reference to vector of modification
names or a string is given (see Pheny::InSilico::MassCalculator::variablePeptide function for instance),
returns a reference
riants;
my $sub = sub {
given ( \@_ ) {
foreach my $variant ( @variants ) {
my ( $partial, $case, $body ) = @$variant;
if ( $partial ) {
given ( [ @_[0 .. $#$case] ] ) {
@variants ) {
my ( $case, $body ) = splice(@variants, 0, 2);
if ( not ref($case) and $case ~~ 'default' ) {
multi_default $name, $body;
} else{
multi $name, $case, $body;
}
}
}
__P
ally come from 'use Moose' are exported to the specified package,
or the current package if none given (unless the current package is 'main').
A lot of this package passes off work to L<Moose> and L<
no strict;
no warnings;
use feature ':5.10';
sub default_port {
my $self = shift;
my $port;
given ( $self->scheme ) {
when ( 'http' ) { $port=80 }
when ( 'https' ) { $port=443 }
}
$port;
r
refered to by the 'C<_dash_profile>' element of %$meta is marked as 'in use'
then a warning is given (just once) and C<new> returns undef, so no sample is
taken.
If $allow_overlap is true, then ove
ctly C<Play()> it.
The second (and third) form opens the
wave output device with the format given
(or if none given, defaults to 44.1kHz,
16 bits, stereo); to produce something
audible you can
est = =$hdl;
$request ~~ s:P5/\s+$//;
#diag $request;
if ($request ~~ rx:P5"^GET /stop-server/") {
last();
};
while (readline($hdl) ~~ rx:P5/\S/) { 1 };
$h
-)
# threads while running an external command)
for @urls -> $t_url {
my $url = $t_url;
$url ~~ s:perl5/%s/$base_url/;
my $inc = map {qq! "-I$_"!}, @*INC;
# Will block forever
# my $outpu
"~~" . $::CLASS->name . "~~";
}
}
};
my $pp = $PrettyPrinter->new();
isa_ok($pp, 'PrettyPrinter');
is($pp->pretty(), '~~PrettyPrinter~~', '.
is(
$pp->pretty({ array => [ \1, \'two', $pp ] }),
'{ array => [ 1, two, ~~PrettyPrinter~~ ] }',
'... recursive multi-methods');
}
{
my $PrettyPrinter2 = class '
ty = ::multi_sub 'PrettyPrinter2::pretty' => ('PrettyPrinter2') => sub {
"~~" . $::CLASS->name . "~~";
};
$::CLASS->add_method('pretty' => ::make_method($pret
ne = $fh.readline;
last unless $line.defined; # exit as soon as possible
if ($line ~~ rx:P5/^=pod/) {
$is_parsing = 1;
%events<start_document>();
}
efined($_line) &&
!($_line ~~ rx:P5/^$/) &&
$_line ~~ rx:P5/^\s(.*?)$/ ) {
while (defined($_line) &&
!($_line ~~ rx:P5/^$/) ) {
interpolate($_line, %events);
*@indextests --> Int|List )
{
my @ret;
for @array.kv -> ($k, $v) {
push(@ret, $k ) if $k ~~ any(@indextests);
}
@ret; # want Item ?? +@ret !! *@ret;
}
# signature from S29draft.pod r
ests --> Int|List )
{
my @ret;
for @array.keys -> $k {
push(@ret, ($k,@array[$k]) ) if $k ~~ any(@indextests);
}
@ret; # want Item ?? +@ret !! *@ret;
}
# signature from S29draft.pod r
*@indextests )
{
my @ret;
for @array.keys -> $k {
push(@ret, Pair($k,@array[$k]) ) if $k ~~ any(@indextests);
}
@ret; # want Item ?? +@ret !! *@ret;
}
# signature from S29draft.pod r
Perl 6: generalisierter Smart-Match-Operator
$s ~~ 1978;
$s ~~ "Hallo, Welt";
$s ~~ /regex/;
$s !~ funktion();
#=Alles zusammen: (änlich wie any)
$s ~~ (123, funktion, /regex/)
($a, $b, $c) !~ ($d, $
e($n) {
'subset int'~$n~' of ValueType where { $^n ~~ Int and -2**'~$n~' <= $^n < 2**'~$n~' };
subset uint'~$n~' of ValueType where { $^n ~~ Int and 0 <= $^n <= 2**'~$n~' };'
}
Clutter
ize($n) {
'subset num'~$n~' of ValueType where { $^n ~~ Num and ...XXXfill in... };
subset complex'~$n~' of ValueType where { $^n ~~ Num and ...XXXfill in... };'
}
Clutter::num_size 32;
Clutt
{ }
method parse (Str $str is copy) {
my $status_line;
if ($str ~~ s/^(.*)\n//) {
$status_line = $0;
} else {
$status_line = $str;
elf = self.SUPER::parse($str);
given ($self) {
my ($protocol, $code, $message);
if ($status_line ~~ /^\d**{3}/) {
# Looks like a r
# HTTP/1.0
require URI;
if ($base.defined && $base ~~ /^ <URI::scheme> \:/) {
# already absolute
return $HTTP::URI_CLASS.new($ba
~~ m/^(\Q$const\E)(.*)/s;
# return unless @_[0] ~~ perl5:m:s:/^(\Q$const\E)(.*)/;
# return unless @_[0] ~~ /^ ( $const )(.*)/; # (putter on #perl6)
# return unless @_[0] ~~
ne = $fh.readline;
last unless $line.defined; # exit as soon as possible
if ($line ~~ rx:P5/^=kwid/) {
$is_parsing = 1;
%events<start_document>();
}
fined($_line) &&
!($_line ~~ rx:P5/^\n$/) &&
$_line ~~ rx:P5/^\s(.*?)$/ ) {
while (defined($_line) &&
!($_line ~~ rx:P5/^\n$/) ) {
interpolate($_line, %events);
~~ m/^(\Q$const\E)(.*)/s;
# return unless @_[0] ~~ perl5:m:s:/^(\Q$const\E)(.*)/;
# return unless @_[0] ~~ /^ ( $const )(.*)/; # (putter on #perl6)
# return unless @_[0] ~~
to HTML
=head1 SYNOPSIS
use Text::GooglewikiFormat;
my $raw = '*bold* _italic_ ~~strike~~';
my $html = Text::GooglewikiFormat::format($raw);
# $html is qq~<p><strong>bold</st
$var (keys %{$to_instantiate||{}}){
my $class = $to_instantiate->{$var};
given(ref $class){
when('HASH'){
my ($package, $method) = %$class;
exit; # exit child
}
}
};
method _req_handler($req) {
my $res = eval {
given($req->uri){
when(m{^/(?:index(?:[.]html?)?)?$}){
return $self->_rende