t(char * class_c)
*
* Parameters:
* class_c : class name
* Returns:
* object of the class given (with ID from Class::Std::Fast set)
*/
SV * _create_object(char * class_c) {
SV * obj;
//
hed or new object
*
* Parameters:
* class_c : class name
* Returns:
* object of the class given (with ID from Class::Std::Fast set)
*/
SV* create_object (char* class_c, int class_len) {
SV
# I want this to work on 5.8 still. Perhaps have this for 5.8, but
# switch on ~~ if the compiler is 5.10?
# Handle a regex
if (ref $match and ref $match e
MMD to C<< infix:<~~>() >>, which presumably
reflects similar semantics, but can finesse things that aren't exact
type matches. Note that all types are scalarized here. Both C<~~>
and C<given>/C<wh
en> provide scalar contexts to their arguments.
(You can always hyperize C<~~> explicitly, though.) So both C<$_>
and C<$x> here are potentially references to container objects.
And since lists promo
match if exists $_{all(list)}
Hash Rule hash key grep match if any($_.keys) ~~ /$x/
Hash Any hash entry existence match if exists $_{$x}
Hash .{Any} h
h an object can be found. If found, it will overwrite all the non-key parameters with the values given (and clear those that aren't given) and then save the object. If not found, it will create an obj
$request ~~ s:P5/\s+$//;
#diag $request;
if ($request ~~ rx:P5"^GET /stop-server/") {
$hdl.close;
last();
};
while (readline($hdl) ~~ rx:P5/\S/) {
);
for @urls -> $t_url {
my $url = $t_url;
$url ~~ s:P5/%s/$base_url/;
diag "Getting HEAD of $url";
my $head = head($url);
ok($head ~~ m:P5/.../, "Got some headers as scalar");
my @head
/");
for @live_urls -> $url {
diag "Getting HEAD of $url";
my $head = head($url);
ok( $head ~~ rx:P5/.../, "Got some headers as scalar");
my @head = head($url);
todo_ok( @head > 3, "Got mor
f ($head ~~ rx:P5"^HTTP\/\d+\.\d+\s+(\d+) (?:.*?\x0D?\x0A)((?:.*?\x0D?\x0A)*?)\x0D?\x0A") {
my ($code, $head) = ($0, $1);
given want {
when rx:P5/Bool/ {
$code ~~ rx:P5/^2
~$head
}
}
};
};
# Unify with URI.pm
sub split_uri (Str $url) {
$url ~~ rx:P5"^http://([^/:\@]+)(?::(\d+))?(/\S*)?$"; #/#--vim
my ($host) = $0;
my ($port) = $1 || 80
his into a todo test
my $buffer = slurp $hdl;
# 1 while ( $buffer ~= $hdl.read() and $buffer !~~ rx:P5"$CRLF$CRLF" );
# my ($status,@headers) = split /$CRLF/, $buffer;
# worry later about lar
se_request {
my Str $chunk = $.remote.readline;
defined $chunk or return undef;
$chunk ~~ m:P5/^(\w+)\s+(\S+)(?:\s+(\S+))?\r?$/;
my Str $method = $0 || '';
my Str $uri = $1 || '
te.readline {
$chunk ~~ s:P5/[\r\n\s]+$//;
if $chunk ~~ m:P5/^([\w\-]+): (.+)/ {
@headers.push( $0 => $1 );
}
last if $chunk ~~ m:P5/^$/;
}
return \
urn 0 };
$proto ||= 'HTTP/0.9';
$uri ~~ m:P5/([^?]*)(?:\?(.*))?/;
my Str $file = $0 || '';
my Str $query = $1 || '';
unless $method ~~ m:P5/^(?:GET|POST|HEAD)$/ {
self.bad
item ''
Returns the raw byte size.
=back
Equivalence to a filetest expression:
$f->size ~~ -s $f
Examples:
# assume $f is a file with 24475 bytes
$f->size() # 24475
$f->size({ f
>exists;
Tells if the file exists or not.
Equivalence to a filetest expression:
$f->exists ~~ -e $f
=item B<mtime> [ equiv: -M ]
$mtime = $f->mtime;
$mtime = $f->mtime(\%options);
R
e C<-M $f> is the script start time
minus file modification time in days. In turn,
$f->mtime() ~~ $f->stat->mtime
Examples:
$f->mtime(); # file mod time since epoch (in secs)
$f->mtime({ as
tt>inline\\also</tt>
Escape Character:
~** not bold ** -> ** not bold **
tilde: ~~ -> tilde: ~
Paragraphs are separated by other blocks and blank lines.
Inlin
_section_hook. running.");
$self->{'begin_section_hook'}($self);
}
qwdebug("Confirmation given (or not needed). Running actions.");
$self->do_actions();
#
# Call the end_section_hook to c
s CSV (this example works from perl 5.10 onwards):
:~$ perl -MApp::CCSV -F/\;/ -lanE 'say if !(@f ~~ @F)' < csv.csv
=head1 SEE ALSO
L<Text::CSV_XS>, L<Config::General>, L<perlrun>
=head1 BUGS
Th
$line is copy {
++$lineno;
$line ~~ s:perl5/[#;].*$//;
$line ~~ s:perl5/\s*$//;
$line ~~ s:perl5/^\s*//;
next if $line ~~ m:perl5/^$/;
if ($line ~~ rx:perl5/^\[\s*(.*)\s*\]$/) {
@con
fig.push({Name => $0});
next;
} elsif ($line ~~ rx:perl5/^(.*?)\s*?=\s*(.*)$/) {
@config.push({Name => ''}) unless +@config;
@config[-1]{"Features"}{$0} = $1;
} else {
die "Invalid lin
match if exists $_{all(list)}
Hash Rule hash key grep match if any($_.keys) ~~ /$x/
Hash Any hash entry existence match if exists $_{$x}
Hash .{Any} h
tical match if $_ »~~« $x
Array any(list) list intersection match if any(@$_) ~~ any(list)
Array Rule array grep match if any(@$_) ~~ /$x/
Array Num
method
Any Rule pattern match match if $_ ~~ /$x/
Any subst substitution match* match if $_ ~~ subst
Any boolean simple expression truth* match if tr
if @params[$i+1] ~~ m:perl5 {:$} {
@params[$i] ~~ s:perl5 {:$}{,};
}
}
}
my $param_list = @params.join(" ");
$param_list ~~ s:perl5 {,$}{}; # rem
(', ')" }
if $function eq '&say' { return "echo @args.join(', '),\"\\n\"" }
if $function ~~ m:perl5 {^&infix:(.*)} { return "(" ~ @args.join( $0 ) ~ ")" }
$function ~ "(" ~ @args.join(
" ~ emit_Variable($_) ~ ";\n" } ~ "$statements\n\}\n";
}
sub emit_Variable ( $s is copy ) {
$s ~~ s:perl5 /^"(.*)"$/$0/;
$s
}
sub emit_Int ( $s ) { $s }
sub emit_Str ( $s ) { $s }
sub emit_Rat
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
t #38:
# regex single { o | k | e };
# # ...
# ok(!( "bokeper" ~~ m/(<?single>) ($0)/ ), 'Failed positional backref');
do {
my %param1 = defin
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
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;
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<