use Test2::Plugin::UTF8;
use Test::Log::Shiras;
plan( 3 );
~~ Set up the Log::Shiras::Switchboard operator here ($ella_peterson) ~~
my $test_class;
ok( lives{ $test_class = Log::Shiras::Test2
wp_response_done__check_md5 ($r2l, $resp);
}
# if ($uri->scheme eq 'file' && $uri->host ~~ ['','localhost']) {
# my $filename = $uri->file;
# require Digest::file;
#
l qw< blessed >;
use overload (); no warnings 'overload'; # '~~' unavailable in Perl 5.8
use overload
'""' => 'to_string',
'~~' => 'check',
'==' => 'check',
'eq' => 'check',
le >>
=item C<< FileName >>
=item C<< FileUri >>
=back
They can be used like this:
if ($file ~~ FileHandle)
{
...
}
Note that there does exist a L<FileHandle> package in Perl core. This
mod
=> q[bool],
STRING => q[""],
NUMBER => q[0+],
REGEXP => q[qr],
SMARTMATCH => q[~~],
map {; $_ => $_ } qw(
SCALAR ARRAY HASH CODE REF GLOB
LVALUE FORMAT IO VSTRING
)
);
) >>
Called with a single argument, tests C<< $_ >>. Yes, this works with lexical
C<< $_ >>.
given ($object) {
when(does ARRAY) { ... }
when(does HASH) { ... }
}
Note: in Scalar::D
->has_fields ? zip $self->fields->@*, @_ : ()
};
$r;
}
},
'~~' => sub {
my( $self, $other ) = @_;
no warnings 'uninitialized';
return $
f ' }
# smart-matching compare the type between two actions
print "matching" if $do_stuff ~~ $AddTodo->(); # prints 'matching'
=head1 AUTHOR
Yanick Champoux <yanick@cpan.org>
=head1 COPYRI
score()};
return $var eq uc($var);
}
my $thing = 'FOO';
my $works = 0;
given ( $thing ) {
when ( is_uppercase ) { $works++ }
}
ok($works);
done_testing();
d value. For ex:
$elem->SetAttributeId("", 3, $value) ~~ $elem->SetAttribute("3", $value)
$elem->SetAttributeId("INSERTITEM", 8, $value) ~~ $elem->SetAttribute("INSERTITEM8", $value)
But these f
. For ex:
$elem->SetAttributeId("KIND", 30, $value) ~~ $elem->SetAttribute("KIND30", $value);
$elem->SetAttributeId("ADDLEAF", 10, $value) ~~ $elem->SetAttribute("ADDLEAF10", $value);
But these
nt->errors ) {
my $err_msg = $error->as_string();
next if $err_msg ~~ $skip;
$on_error->( $c, "HTMLLint:" . $error->as_string );
}
given ( $action ) {
return $action->{filter} when $SetVisibilityFilter;
default { return $state }
}
}
sub todos($action=undef,$state=[]) {
given( $
given ( $action ) {
return $action->{filter} when $SetVisibilityFilter;
default { return $state }
}
}
sub todos($action=undef,$state=[]) {
given( $
llowed) = @_;
my $allow = $c->user && $c->check_any_user_role( @$allowed )
|| 'PUBLIC' ~~ @$allowed;
return $allow;
}
sub who_can_access
{
my $c = shift;
my
uld be consistent with Dir
my $content = $self->{files}{ $self->full_path($file) };
# 5.10: given(ref($content))
if( my $ref = ref $content ){
local $/; # do this here because of perl bug
i had this in it:
#sub grep {
# my ( $array, $filter ) = @_;
# my @result = CORE::grep { $_ ~~ $filter } @$array;
# return wantarray ? @result : \@result;
#}
sub grep {
my $arr = CORE::
t,@fileparse,$type,$type_human);
if(!$wishlist || 'Filesystem' ~~ @$wishlist || "@$wishlist" =~ $regex_filesystem_contains || 'MIME' ~~ @$wishlist){
# print STDOUT " ** properties: -asks for Fil
ishlist is given (so getting xattr is the default), or in case $wishlist is given, skip when xattr is omitted
if(!$wishlist || 'Extended Attributes' ~~ @$wishlist || 'Filesystem::Xattr' ~~ @$wishlist
ntscale};
}
# Determine the current font and set font-related members.
# If $plain_with_size is given (a number), use a plain font
# of that size. Otherwise, use the font specified by the
# HTML con
consisting of the result of using the given class to format the
given HTML file according to the given (optional) options. Internally it calls
C<< SomeClass->new( ... )->format( ... ) >> on a new HTML
nsisting of the result of using the given class to format the
given HTML source according to the given (optional) options. Internally it
calls C<< SomeClass->new( ... )->format( ... ) >> on a new HTML
e second example,
only the the single argument I<name> will be recognized.
If I<default> is not given (or is undef), then B<arguments()> will simply
flatten the argument list into a hash and assume t
n", and Class::Multimethods does it like this:
=over 4
=item 1.
If the types of the arguments given (as determined by C<ref>) exactly
match the types specified in any variant of the multimethod, th
oach as in grep().
if ( ref $filter eq 'Regexp' ) {
return List::Util::first( sub { $_ ~~ $filter }, @$self );
}
return List::Util::first( sub { $filter->() }, @$self );
}
metho
{
return @$self[int rand @$self];
}
method grep($filter) {
my @result = CORE::grep { $_ ~~ $filter } @$self;
return wantarray ? @result : \@result;
}
method popn($times) {
Carp::F
= @_;
my $algorithms = [qw(sha1 md5)];
$args{algorithm} //= 'sha1';
$args{algorithm} ~~ $algorithms or
Carp::croak("algorithm must be @{[ $algorithms->join(' or ' ) ]}");
my $
:MD5" };
my $format = [qw(hex base64 binary)];
$args{format} //= 'hex';
$args{format} ~~ $format or
Carp::croak("format must be @{[ $format->join(' or ') ]}");
my %prefix = ( h