nzip => $pif,
-d => $path ], '>', '/dev/null';
my $ok = $status ?
($status ~~ [1, 1<<8] ? 1 : 0) # oddity of unzip 'warning' status
: 1;
if ($ok) {
return;
1: lines 'file'
@_ or return enlist { <$fh> // () };
# confess if not 2nd form
$_[0] ~~ 'chomp' or confess 'cannot handle parameters ' , join ',', @_ ;
# lines chomp => 'file'
e
ts, 0, scalar( @_string_formats );
my %params;
$params{ $_boolean_formats[$_] } = ~~1
for grep { $boolean_parts[$_] } 0 .. $#_boolean_formats;
$params{ $_integer_
l('PerlFunc')->list;
my @pages = sort {$a cmp $b} $c->model('Index')->find_modules;
given ($query) {
when (@functions) {
return $c->response->redirect( $c->uri_for('/functio
(/^($query)$/i ~~ @pages) {
my $matched_page = $1;
return $c->response->redirect( $c->uri_for('/view',split('::',$matched_page)) );
}
when (/^($query.*)$/i ~~ @pages) {
r context. The first match at any position is returned.
$str = "abracadabra";
if $str ~~ m:overlap/ a (.*) a / {
@substrings = $/.matches(); # bracadabr cadabr dabr br
}
ontext, or a disjunction of matches in a scalar context.
$str = "abracadabra";
if $str ~~ m:exhaustive/ a (.*) a / {
@substrings = $/.matches(); # br brac bracad bracadabr
in a value context (void,
Boolean, string, or numeric), or when it is an explicit argument of
a C<~~>. Otherwise it's a rule constructor. So this:
$var = /pattern/;
no longer does the match
the arguments:
for @kv <-> $key, $value {
$key ~= ".jpg";
$value *= 2 if $key ~~ :e;
}
=head2 Stub declarations
To predeclare a subroutine without actually defining it, use
push @a, "foo";
push @a, \(1,2,3);
push @a, "bar";
...
my ($i, $j, $k);
@a ~~ rx/
<,> # match initial elem boundary
:(Int $i,Int
**
non cmp <=> .. ILLEGAL cmp
chain == eq ~~ ($a op $b) and ($b op $c) eqv
list | & ^ Z op($a; $b; $c)
=item IO ~~ :X
X<:r>X<:w>X<:x>X<:o>X<:R>X<:W>X<:X>X<:O>X<:e>X<:z>X<:f>X<:d>X<:l>X<:p>
X<:S>X<:b>X<:c>X<:t>X<:u>X<:g>X<:k>X<:T>X<:B>X<:M>X<:A>X<:C>
=item EXPR ~~ :X
$file.:X
$file ~~ :X
A file
ero size.
Likewise, just call C<.s> directly if you actually want to know the file's
size, since C<~~ :s> only returns a boolean.
The C<.T> and C<.B> methods will be replaced by some filetype guessin
fective uid to something else.
You can test multiple features using junctions:
if $filename.IO ~~ :r & :w & :x {...}
=back
=head2 IO::ACL
This is a basic abstraction; for better control, use t
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
isa => '_p_svn_fs_path_change_t',
required => 1,
handles => [
grep { not $_ ~~ [qw(new DESTROY)] }
map { $_->name }
any_moose('::Meta::Class')->initializ
nameservers for this zone
my ($resolvers_ns) = $self->nameservers;
unless ( $resolvers_ns ~~ @ns_addresses ) {
$self->errorstring("NS $resolvers_ns is nonauth for $zone");
pri
) = @_;
my $qs = $self->knobs;
foreach my $q (@{$qs}) {
my $set_value;
given ($q->ui_type) {
when ('Menu') {
$set_value = $q->value || $q->data->[
]
);
INTERACT: {
my $state = $main_menu->run;
given ($state) {
when (
$_ ~~ [
Hobocamp::Dialog::DLG_EXIT_ESC(), Hobocamp::
die("I don't know what the error code $_ is!");
}
}
given ($main_menu->value->{'name'}) {
when ('Introduction') {
my $msg_box =
);
croak "object method called as class method" unless ref $self;
my($orig, $pos);
given(scalar(@_)) {
when (2) { ($orig, $pos) = @_ }
when (1) { ($orig) = @_ }
when (0) { croak
tiny @list;
no lib::tiny @list;
=head1 DESCRIPTION
This module simply adds and removes the given (existant on add) paths as-is to/from @INC in the same manner as L<lib> but in a '::Tiny' manner.
m username
The username associated with the account being created.
=item givenName
The user's given (first) name.
=item familyName
The user's family (last) name.
=item password
The user's passw
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
help {
say <<'OUT';
usage:
install
upgrade
current-version
OUT
}
help unless $ARGV[0];
given ( $ARGV[0] ) {
when ('install') { install() }
when ('upgrade') {
y $player = $game->curplayer;
my @actions = qw{ build discover treat share pass drop };
given ( $game->state ) {
when ('actions') {
foreach my $action ( @actions ) {
=> sub {
my $game = Games::Pandemic->instance;
# FIXME: check src vs current player
given ( $game->state ) {
when ('end_of_actions') { $K->yield('_draw_cards' ); }
whe
@labels ; $i++ ) {
my $x = $i * 800 / ( @labels - 1 );
my @axis_modes;
given ( $labels[$i] ) {
when ('CPU') {
@axis_modes = @MODES_CPU
s builtin {
has $.f;
}
# This infix:<~~> doesnt work yet.
multi sub infix:<~~> ($x, Rul $r) is primitive is safe is builtin {$r.f.($x)}
multi sub infix:<~~> (Rul $r, $x) is primitive is safe is bu
y $m;
while 1 \{
my $s = substr($str,$pos) // last;
$m = $s ~~ $re or last;
my $m0 = {$m}[0];
my $at = $pos + $m0.from;
!! $a }))";
return $code;
}
# Use of Rul awaits working infix:<~~> .
#'Rul.new(:f(sub($_s_){$_s_ ~~ '~"$hook$adverbs$qo$pat$qc}))";
"$hook$adverbs$qo$pat$qc";
}
# These macro