# available
return \$given ~~ \$_->{features}->{$entry};
} else {
}";
eval $eval_string; ## no critic
}
if ( not grep {$_ ~~ /hostname/} @functions ) {
eval '
sub hostname (;$) ## no critic (
# available
return $given ~~ $_->{features}->{hostname};
} else {
itespaces with 1 whitespace
return $value;
}
# Description:
# Returns useflag settings of the given (installed) package.
# @useflags=$pxs->getUseSettingsOfInstalledPackage("dev-perl/perl-5.8.8-r3")
if data is incorrect.
=item Anything else
Data's value must magically match rule's value (with C<~~> operator).
=back
Optional third argument (C<$overrule>) must be a coderef. It will be called wi
nless ref $data eq $rule;
$result = $data;
} else {
die 'INVALID' unless $data ~~ $rule;
$result = $data;
}
if ($overrule)
{
local $_ = $result;
iants) = @_;
return sub {
return unless ref $_ eq 'ARRAY';
my @items = grep $_ ~~ @variants, keys %{{ map { $_ => 1 } @$_ }};
return \@items if scalar(@items) > 0;
};
}
queue} = PICA::Modification::Queue->new( $args{queue} )
unless 'PICA::Modification::Queue' ~~ reftype $args{queue};
$args{check} ||= 60;
if (($args{via} // '') =~ /^https?:\/\//)
};
}
croak "missing 'via' parameter to retrieve PICA+ records from"
unless 'CODE' ~~ reftype $args{via};
bless \%args, $class;
}
sub get {
my ($self, $id) = @_;
my $requ
(time()-$self->{check});
return $request if ($next cmp $last) == -1;
$request->update( 0 ~~ $self->pending($request) ? 1 : 0 );
$self->{queue}->update( $id => $request );
$self->{que
($retval->{xen_package}) = grep { m!repository/packages/xen/builds! } @{ $precondition ~~ dpath '/host/preconditions//filename' };
push @{$retval->{test}}, get_test
cility.
=head2 get_test_list_from_precondition
Utility function to extract testprograms from a given (sub-) precondition.
=head2 get_testrun_overview
This function reads and parses all preconditio
operator, C<~~>, can be used in a variety of situations. Here
are a few examples:
say "Yep" if $banana ~~ @fruits; # is the element is present in the array?
exit if $error ~~ %fatal;
# is the key present in the hash?
function() if $condition ~~ True # is the condition true?
%my_hash ~~ %their_hash # do the hashes have the same keyes?
Smart matching is
$a ~~ /foo/ { ... } # true if $a contains "foo"
The C<//> matching operator is documented in L<doc:perlop>. It operators on
C<$_> by default, or can be bound to another variable using the C<~~>
s = ['group', 'matrix', 'cube', 'hypercube']; # if you go past here, you've gone too far...
given (reftype $tree) {
# Common code for both HASHs and ARRAYs
when (/HASH|ARRAY/) {
# and all foreign keys that refer to it.
elsif ($pkey) { $fk_list = [ grep { $colnames->{$_} ~~ /^$pkey$/ } keys %$colnames ]; }
# If only FKT is given, then the result set contains all fore
a; # ( c ) ~~ after {/b/} (a, b, c)
@gots = after_incl {$_} @a; # ( b, c ) ~~ after_incl {/b/} (a, b, c)
@gots = before {$_} @a; # ( a ) ~~ before {/b/
b, c)
@gots = before_incl {$_} @a; # ( a, b ) ~~ before_incl {/b/} (a, b, c)
@gots = indexes {$_} @a; # ( 1 ) ~~ indexes {/b/} (a, b, c)
$got = firstval {
ts)
# Seen-hash: Use hashrefs instead of arrayrefs:
# [ 11, 12, 14, 14, 14, 15 ] ~~ { 11 => 1, 12 => 1, 14 => 3, 15 => 1 }
#
# Construct a work-object
my $lc = Li
) {
print ( $v->{time} - $t ) . ": $v->{value}\n"
# Or with human-readable times
# print ~~ localtime ( $v->{time} - $t ) . ": $v->{value}\n"
}
=head1 AUTHOR
Luke Poskitt, C<< <ltp at cp
>distributions($id);
my $kwalitee = $authors->kwalitee($id);
print "$name has published ", ~~ @dists, " distributions:\n";
@dists = sort { lc($a->dist) cmp lc($b->dist) } @dists;
for m
'.$now if ( 'created_at' ~~ [ $self->app->model->resultset( $self->{resource} )->result_source->columns ] );
$self->{_payload}->{updated_at} = ''.$now if ( 'updated_at' ~~ [ $self->app->model->res
my $now = DateTime->now ;
$self->{_payload}->{updated_at} = ''.$now if ( 'updated_at' ~~ [ $self->app->model->resultset( $self->{resource} )->result_source->columns ] );
}
1;
__END__
=p
enerateChain>.
Uses in generate call to stringify chains.
=cut
func _asStrings($generated) {
given ( $generated->{class} ) {
when ( "Atom" ) { return [ $generated->{value} ] }
when ( "Sequenc
=~ s/[-\W]/_/g;
$name;
}
func _range($val, $dent) {
my $ret = "";
$ret .= '[';
given ( $val->{type} ) {
when ( 'hex' ) {
$ret .= join('-', map { '\x{' . $_ . '}' } $val->{min},
lue} \n";
}
}
$ret .= "]";
$ret;
}
func _string($val, $dent) {
my $ret = "";
given ( $val->{type} ) {
when ( 'hex' ) {
$ret = join('', map { '\x' . $_ } @{$val->{value}});
st operators
nonassoc < > <= >= lt gt le ge
nonassoc == != <=> eq ne cmp ~~
left &
left | ^
left &&
left |
now 0
my $z = "c" cmp "b"; #$x is now positive
=head3 See also
L</X E<lt>=E<gt> Y>
=head2 X ~~ Y
=head3 Class
This belongs to L<perlop/Equality Operators>.
=head3 Description
This is the sm
ead.
=head3 Example
See L<perlsyn/"Smart matching in detail"> for examples.
=head3 See also
L</~~X>, L<perlsyn/"Smart matching in detail">, and L<perlfunc/scalar>
=head2 X & Y
=head3 Class
This
rgument with the
# property value.
#
# Return a sorted list of all property names if no argument given (the
# list may be empty).
# -----------------------------------------------------------------
su
$file = $next_file->() ) ) {
my $mtime = stat($file)->mtime;
if ( ( !$force ) and $mtime ~~ $mtimes{$file} ) {
next;
}
my $perlcritic = "perlcritic $ARGV{-C} $file";
e ( defined( my $file = $next_file->() ) ) {
my $mtime = stat($file)->mtime;
if ( $mtime ~~ $mtimes{$file} ) {
next;
}
my $perltidy = "perltidy $ARGV{-P} $file";
if
#################################################
=item B<findInPath> - locate all files with a given (normalized) name
@list = $obj->findInPath($a_file_name);
Example:
@time_h = $includes
###########################################
=item B<findFirstInPath> - locate first file with a given (normalized) name
@list = $obj->findFirstInPath($a_file_name);
Example:
$includes2 =
#############################################
=item B<findBestInPath> - locate best file with a given (normalized) name
@list = $obj->findBestInPath($a_file_name,
$reference_to_comparison_f
sub english_to_num {
my ( $class, $width, $style ) = @_;
given ( lc $style ) {
when ('solid') {
given ($width) {
when (0) { return 7; }
wh
default { return 7; }
}
}
when ('dash') {
given ($width) {
when (1) { return 3; }
when (2) { return 8; }
default { return 9; }
}
}
when ('dash dot dot') {
given ($width) {
when (1) { return 11; }
when (2) { return 12; }
lse { }
< > <= >= lt gt le ge unless (e) { } elsif (e) { } else { }
== != <=> eq ne cmp ~~ given (e) { when (e) {} default {} }
&
| ^ METACARACTERES EXP. REG. MODIFICADORES