| $Is_NetWare);
if ($p1 ne $p2) {
my($dev1, $ino1, $dev2, $ino2);
($dev1, $ino1) = stat($p1);
($dev2, $ino2) = stat($p2);
($dev1 ~~ $dev2 && $ino1 ~~ $ino2);
}
else {
1;
}
}
1;
te @pure_statements;
@pure_statements = ();
state $VALIDATE_PURE_GIVEN = qr{
\A given (?<GIVEN> (?<ws_post_kw> $OWS ) \(
(?<ws_pre_expr> $OWS )
return !defined $left;
}
# 2. Objects on the RHS can't be handled (at all, because no ~~ overloading available)...
croak 'Smart matching an object breaks encapsulation'
if $ri
removed in this version of Perl
use Switch::Back; # But this module brings them back
given ($some_value) {
when (1) { say 1; }
when ('a') { say 'a'; continue; }
y ($self, $type) = @_;
given ($type) {
when (STORED) { $self->{type} ~~ ATTR_STORED }
when (CACHED) { $self->{type} ~~ ATTR_CACHED }
when (KEY) { $self->{type} ~~ ATTR_KEY }
when (ANY
se { }
** unless (e) { } elsif (e) { } else { }
! ~ \ u+ u- given (e) { when (e) {} default {} }
=~ !~
* / % x NUMBERS vs STRINGS FALSE vs TR
== != eq ne
< > <= >= lt gt le ge < > <= >= lt gt le ge
== != <=> eq ne cmp ~~ <=> cmp
&
| ^ REGEX MODIFIERS REGEX METACHARS
&& /i c
y ($self, $type) = @_;
given ($type) {
when (STORED) { $self->{type} ~~ ATTR_STORED }
when (CACHED) { $self->{type} ~~ ATTR_CACHED }
when (KEY) { $self->{type} ~~ ATTR_KEY }
when (ANY
erhaps you wanted: "
. ":where({ $param->{var} ~~ $match{where_expr} })"
)
: $ma
multi factorial ($n == 0) { 1 }
multi alert ($msg eq "") {}
multi alert ($msg ~~ undef) {}
multimethod add_client ($data, $ID =~ /X\w{4}\d{6}/) {
die "Can't add an X
{
return $_[0]->{postfix} // q~~ if !defined $_[1];
$_[0]->{postfix} = $_[1];
return $_[0]->{postfix};
}
sub prefix {
return $_[0]->{prefix} // q~~ if !defined $_[1];
$_[0]->{pre
fix} = $_[1];
return $_[0]->{prefix};
}
sub template {
return $_[0]->{template} // q~~ if !defined $_[1];
$_[0]->{template} = $_[1];
return $_[0]->{template};
}
sub handle_entry {
'eq' => sub{ &_op_overload( @_, 'IS' ) },
# Full Text Search operator
'~~' => sub{ &_op_overload( @_, '@@' ) },
fallback => 1,
);
use Wanted;
our $VE
are overloaded:
+, -, *, /, %, <, <=, >, >=, !=, <<, >>, lt, gt, le, ge, ne, &, |, ^, ==, eq, ~~
Thus a field named "dummy" could be used like:
$f + 10
which would become:
dummy + 10
ceholder in:
$f == "'JPY'"
Simply provide:
$f == '?'
You can use the search operator C<~~> for SQL Full Text Search and it would be converted into C<@@>:
Let's imagine a table C<articles>
eq | ne | lt | le | gt | ge
| == | != | < | <= | > | >=
| =~ | !~ | ~~
) \Z }x;
my $expected_code = $test_code;
my ($got_code, $comparator);
for m
ed[0];
ok $result eq $expected[0];
ok $result == $expected->[0]->{a}[0];
ok $result ~~ $expected[0];
ok $result !~ $expected[0];
ok $result > twice($expected{'half'});
=hea
$result --> 1
# $expected->[0]->{a}[0] --> undef
#
ok 4 - $result ~~ $expected[0]
not ok 5 - $result !~ $expected[0]
# Failed test at demo/ts_ok-er.pl line 1
++ -- ** ! ~ + -
=~ !~ * / % x
<< >> lt gt le ge cmp ~~
== != <=> . .. ... ,
& | ^ && || //
? : **= += -= .= *=
1 } (
qw{
-> ++ -- ** ! ~ + -
=~ !~ * / % x . << >>
< > <= >= lt gt le ge
== != <=> eq ne cmp ~~
& | ^ && || // .. ...
? :
= **= += -= .= *= /= %= x= &= |= ^= <<= >>= &&= ||= //=
=> <> <<>>
emented on this Perl version"
# 52 implicit smartmatch in given/when
given ('foo') {
when ('bar') { continue; }
when ($_ ~~ 'quux') { continue; }
default { 0; }
}
####
# 53 conditions in e
er> and inherits from L<Markdown::Parser::Element>
For example:
Tickets for the event are ~~€5~~ ++€10++
Which would become:
Tickets for the event are <del>€5</del> <ins>€10</ins>
concat_amg, /* 0x3f . */
concat_ass_amg, /* 0x40 .= */
smart_amg, /* 0x41 ~~ */
ftest_amg, /* 0x42 -X */
regexp_amg, /* 0x43 qr */
max_amg_code
nc may be used together.
=item *
The smartmatch operator (C<~~>) was changed so that the right-hand side
takes precedence during C<Any ~~ Object> operations.
=item *
A bug has been fixed in the ta
ve caught it
earlier.
=item Repeated format line will never terminate (~~ and @# incompatible)
(F) Your format contains the ~~ repeat-until-blank sequence and a
numeric field that will never go blan
.
=item Smart matching a non-overloaded object breaks encapsulation
(F) You should not use the C<~~> operator on an object that does not
overload it: Perl refuses to use the object's underlying stru
[ 1, 2, 0 ], 0 ];
$e = '"abc" ~~ (%s)';
$subs{'~~'} = $e;
push @tests, [ "abc", $e, '(~~)', '(NM:~~)', [ 1, 1, 0 ], 0 ];
$subs{'-X'} = 'do { my $f = (%s);'
xis pointing "northwest".
The default value is 0 (no rotation).
=item 'full' => color_spec
If given (no default), draw the full ellipse (not just the arc)
in this color, with a dot at its center.
ne> tells it to
"reject!", and I<counte> bids it "count!". In each case, an instruction
is being given (and in a void context too, so no backchat is expected).
Handling scalar and list contexts is a
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.