}
default {
die q(I don't know what to do with $foo);
}
}
C<given(EXPR)> will assign the value of EXPR to C<$_>
within the lexical scope of the block, so it's simi
he power comes from implicit smart matching:
when $foo
is exactly equivalent to
when $_ ~~ $foo
In fact C<when EXPR> is treated as an implicit smart match most of the
time. The exceptions
ral array
or hash as the argument to C<when>, it is turned into a
reference. So C<given(@foo)> is the same as C<given(\@foo)>,
for example.
C<default> behaves exactly like C<when True>, which is
to s
) = @_;
return if $line =~ /(^#|^\n)/;
my ($key, $value) = split /\s+/, $line;
$self->{$key} = (
$key ~~ @has_scope ?
[split /\?/, $value] :
$value
);
}
1;
%attrs = map {
my $asref = $self->meta->find_attribute_by_name($_)->type_constraint->name ~~ /Ref/;
$_, $entry->get_value($_, asref => $asref);
} $entry->attributes;
return (
args) = parse_line('\s+', 0, $cmd);
next PROMPT unless $thiscmd;
unless ( lc($thiscmd) ~~
[ qw/h help q quit open create freeze thaw/ ]
) {
unless ( $self->_get_curr
( index($args[0], '--') == 0 ) {
my $f_opt = shift @args;
substr($f_opt, 0, 2, '');
given (lc($f_opt//'')) {
$format = 'YAMLXS' when "yaml";
$format = 'YAML' when "syck";
( index($args[0], '--') == 0 ) {
my $f_opt = shift @args;
substr($f_opt, 0, 2, '');
given (lc($f_opt//'')) {
$format = 'YAMLXS' when "yaml";
$format = 'YAML' when "syck";
ess ref $self->report;
return unless defined $self->report->status
and $self->report->status ~~ [qw/DONE FAIL/];
return $self->report->status
}
sub failed {
my ($self, $reason) = @_;
i
ump {
my ($self) = @_;
return unless ref $self->report;
return unless $self->report->status ~~ [ qw/DONE FAIL/ ];
return $self->report->netinfo
}
sub report { info(@_) }
sub info {
my ($s
he current parameter
set.
=item strip_like($regex)
Remove all parameters whose names match the given (qr-quoted) regex e.g.
$qq->strip_like(qr/^utm/)
Does NOT match against parameter values.
le-colon, dash or slash
$opts{cpan} =~ s![/-]!::!g if $opts{cpan};
# "If no argument is given (but the switch is specified - not specifying
# the switch will include everything), it defau
my $package = $params->{package};
unless ( $self->{fake_answer} ) {
unless ( $package ~~ $self->show_packages() ) {
return {error => 1, text => "No such package $package on server"};
sub mk_query_to_server {
my ( $self, $method, $url, $params ) = @_;
unless ( $method ~~ [ qw( POST GET ) ] ) {
confess "Unknown request method: '$method'";
}
confess "UR
h my $obj (@{$array}) {
while ( my ($key, $value) = each %{$obj} ) {
if ( $key ~~ @special_keys ) {
$self->_date_to_datetime($value);
}
$obj
$call, $isaRef, @params ) = @_;
for my $param ( @params )
{
given ( $param )
{
# Define singleton class
# via use param
=> $pkg
};
for ( @attrs )
{
given( $_ )
{
when ('Public' ) { makePublic ($call,$pkg,$sym,$r
e of property.
sub addProperty
{
my ( $this, $attr, $value ) = @_;
given( $attr )
{
when( /^__/ ) { return addPrivate(@_) }
when( /^_/ )
for a pathway will be available
for many individuals, meaning that we now have many tests of the given (single)
hypothesis.
(This should not be confused with the scenario of multiple hypothesis
testin
############
# ===
# NEW create a new population path-scan object
# === ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=head2 new
The object constructor takes a mandatory, but otherwise un-ordere
gn the manner in which genes will be internally organized
# ====== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=head2 assign
This method assigns the manner in which genes will b
class = shift;
my $self = {};
bless $self, $class;
return $ReproxySelf = $self;
}
# given (clientproxy, primary_res_hdrs), initiate proceedings to process a
# request for a reproxy resour
# now try to get it processing again
MogileFS::ProcManager->ProcessQueues;
}
}
# given (job, pid), record that this worker is about to die
# $level is so we can tell if watchdog reques
(1) {
my ($pkg, $sub) = (caller(++$min_level))[ 0, 3 ];
last unless [ $pkg, $sub ] ~~ /^(Aspect::|dip\b)/o;
}
for my $level ($min_level .. $min_level + $depth - 1) {
my
)
} keys %{$namespace};
for my $hash_symbol (@hash_symbols) {
next if $hash_symbol ~~ [qw(counter quantize opt)];
my $hash = *{ $namespace . $hash_symbol }{HASH};
no wa
$self = shift;
given ("$^O") {
when (/^freebsd$/) { return 'pkg_info'; }
when (/^netbsd$/) { return 'pkg_info'; }
when (/^linux$/) {
given (Linux::Distribution
g_name {
my $self = shift;
my $pkg = $self->{target};
my $type = $self->{type};
given (ref $pkg) {
when ('') {
return $pkg if ($pkg =~ m/^[A-Za-z0-9\-\_\.\/]+$/);
}
return $ret;
};
# see if what we are returning is serializable itself
given (ref $value) {
when ('HASH') {
while (my ($k, $v) = each %$value) {
# Iterate through array and recursively call process, call code refs,
# and run tests
given (ref $obj) {
when ('ARRAY') {
return map(process($_), @{$obj});
}
is a scalar,
# debug it?!
if (defined $func and $Modes->{$level}) {
given (ref $func) {
when ("CODE") { return &$func; };
when ("") { retur
$self = shift;
given ("$^O") {
when (/^freebsd$/) { return 'pkg_info'; }
when (/^netbsd$/) { return 'pkg_info'; }
when (/^linux$/) {
given (Linux::Distribution
g_name {
my $self = shift;
my $pkg = $self->{target};
my $type = $self->{type};
given (ref $pkg) {
when ('') {
return $pkg if ($pkg =~ m/^[A-Za-z0-9\-\_\.\/]+$/);