item ''
Returns the raw byte size.
=back
Equivalence to a filetest expression:
$f->size ~~ -s $f
Examples:
# assume $f is a file with 24475 bytes
$f->size() # 24475
$f->size({ f
>exists;
Tells if the file exists or not.
Equivalence to a filetest expression:
$f->exists ~~ -e $f
=item B<mtime> [ equiv: -M ]
$mtime = $f->mtime;
$mtime = $f->mtime(\%options);
R
e C<-M $f> is the script start time
minus file modification time in days. In turn,
$f->mtime() ~~ $f->stat->mtime
Examples:
$f->mtime(); # file mod time since epoch (in secs)
$f->mtime({ as
tt>inline\\also</tt>
Escape Character:
~** not bold ** -> ** not bold **
tilde: ~~ -> tilde: ~
Paragraphs are separated by other blocks and blank lines.
Inlin
_section_hook. running.");
$self->{'begin_section_hook'}($self);
}
qwdebug("Confirmation given (or not needed). Running actions.");
$self->do_actions();
#
# Call the end_section_hook to c
s CSV (this example works from perl 5.10 onwards):
:~$ perl -MApp::CCSV -F/\;/ -lanE 'say if !(@f ~~ @F)' < csv.csv
=head1 SEE ALSO
L<Text::CSV_XS>, L<Config::General>, L<perlrun>
=head1 BUGS
Th
$line is copy {
++$lineno;
$line ~~ s:perl5/[#;].*$//;
$line ~~ s:perl5/\s*$//;
$line ~~ s:perl5/^\s*//;
next if $line ~~ m:perl5/^$/;
if ($line ~~ rx:perl5/^\[\s*(.*)\s*\]$/) {
@con
fig.push({Name => $0});
next;
} elsif ($line ~~ rx:perl5/^(.*?)\s*?=\s*(.*)$/) {
@config.push({Name => ''}) unless +@config;
@config[-1]{"Features"}{$0} = $1;
} else {
die "Invalid lin
if @params[$i+1] ~~ m:perl5 {:$} {
@params[$i] ~~ s:perl5 {:$}{,};
}
}
}
my $param_list = @params.join(" ");
$param_list ~~ s:perl5 {,$}{}; # rem
(', ')" }
if $function eq '&say' { return "echo @args.join(', '),\"\\n\"" }
if $function ~~ m:perl5 {^&infix:(.*)} { return "(" ~ @args.join( $0 ) ~ ")" }
$function ~ "(" ~ @args.join(
" ~ emit_Variable($_) ~ ";\n" } ~ "$statements\n\}\n";
}
sub emit_Variable ( $s is copy ) {
$s ~~ s:perl5 /^"(.*)"$/$0/;
$s
}
sub emit_Int ( $s ) { $s }
sub emit_Str ( $s ) { $s }
sub emit_Rat
match if exists $_{all(list)}
Hash Rule hash key grep match if any($_.keys) ~~ /$x/
Hash Any hash entry existence match if exists $_{$x}
Hash .{Any} h
tical match if $_ »~~« $x
Array any(list) list intersection match if any(@$_) ~~ any(list)
Array Rule array grep match if any(@$_) ~~ /$x/
Array Num
method
Any Rule pattern match match if $_ ~~ /$x/
Any subst substitution match* match if $_ ~~ subst
Any boolean simple expression truth* match if tr
t #38:
# regex single { o | k | e };
# # ...
# ok(!( "bokeper" ~~ m/(<?single>) ($0)/ ), 'Failed positional backref');
do {
my %param1 = defin
difier: sets modifications if $modif, a reference to vector of modification
names or a string is given (see Pheny::InSilico::MassCalculator::variablePeptide function for instance),
returns a reference
difier: sets modifications if $modif, a reference to vector of modification
names or a string is given (see Pheny::InSilico::MassCalculator::variablePeptide function for instance),
returns a reference
riants;
my $sub = sub {
given ( \@_ ) {
foreach my $variant ( @variants ) {
my ( $partial, $case, $body ) = @$variant;
if ( $partial ) {
given ( [ @_[0 .. $#$case] ] ) {
@variants ) {
my ( $case, $body ) = splice(@variants, 0, 2);
if ( not ref($case) and $case ~~ 'default' ) {
multi_default $name, $body;
} else{
multi $name, $case, $body;
}
}
}
__P
no strict;
no warnings;
use feature ':5.10';
sub default_port {
my $self = shift;
my $port;
given ( $self->scheme ) {
when ( 'http' ) { $port=80 }
when ( 'https' ) { $port=443 }
}
$port;
ally come from 'use Moose' are exported to the specified package,
or the current package if none given (unless the current package is 'main').
A lot of this package passes off work to L<Moose> and L<
ector on
the right. Our example is roughly equivalent to this closure:
{ $_.does(Str) and $_ ~~ /^[isnt|arent|amnot|aint]$/; }
except that a subtype knows when to call itself.
A subtype is not
um where { $^n % 2 == 0 }
my Str_not2b $hamlet;
$hamlet = 'isnt'; # Okay because 'isnt' ~~ /^[isnt|arent|amnot|aint]$/
$hamlet = 'amnt'; # Bzzzzzzzt! 'amnt' !~ /^[isnt|arent|amnot|a
Rules::Common :profanity;
multi sub mesg ($mesg of Str where /<profanity>/ is copy) {
$mesg ~~ s:g/<profanity>/[expletive deleted]/;
print $MESG_LOG: $mesg;
}
multi sub mesg ($mesg of
r
refered to by the 'C<_dash_profile>' element of %$meta is marked as 'in use'
then a warning is given (just once) and C<new> returns undef, so no sample is
taken.
If $allow_overlap is true, then ove
$string;
$result ~~ s:Perl5:g/&\#(\d+);?/{chr($0)}/;
$result ~~ s:Perl5:g/(&\#[xX]([0-9a-fA-F]+);?)/{my $c = :16($1); $c < 256 ?? chr($c) !! $0}/;
$result ~~ s:Perl5:g/(&(\w+);?)/{%en
code\n "
# ) if $!;
#}
#%subst{$unsafe_chars}($string);
$result ~~ s:Perl5:g/([$unsafe_chars])/{
%char_to_entity.exists($0)
?? %char_to_e
}
else {
# Encode control chars, high bit chars and '<', '&', '>', '"'
$result ~~ s:perl5:g/([^\n\r\t !\#\$%\'-;=?-~])/{
%char_to_entity.exists($0)
?? %
if @params[$i+1] ~~ m:perl5 {:$} {
@params[$i] ~~ s:perl5 {:$}{,};
}
}
}
my $param_list = @params.join(" ");
$param_list ~~ s:perl5 {,$}{}; # rem
"$statements\n" ~
" # TODO - _end_pad\n";
}
sub emit_Variable ( $s is copy ) {
$s ~~ s:perl5/^"(.*)"$/$0/;
$s
}
sub emit_Int ( $s ) { $s }
sub emit_Str ( $s ) { $s }
sub emit_Rat
f $default eq '';
# rewrite '$name,' to '$name = default,'
my ($name, $separator) = $param ~~ m:perl5 {(.*)(.)};
$default ~
$name ~
' = ' ~
$separator
}
# -- Main prog
$got, Rule $expected, Str $desc?, :$todo, :$depends) returns Bool is export {
my $test := $got ~~ $expected;
Test::proclaim($test, $desc, $todo, $got, $expected, $depends);
}
## unlike
sub u
, Rule $expected, Str $desc?, :$todo, :$depends) returns Bool is export {
my $test := not($got ~~ $expected);
Test::proclaim($test, $desc, $todo, $got, $expected, $depends, :negate);
}
# eval
o, :$depends) returns Bool is export {
try { code() };
if ($!) {
&Test::ok.goto($! ~~ $match, $desc, :$todo, :$depends);
}
else {
Test::proclaim(undef, $desc, $todo, "N
elsif (($k.chars > 1) && (substr($k,-1,1) eq "x") # XXX - excess parens required
&& ($k ~~ %rx_helper_cache{'re_x'})) {
my $n = 0+ ~$0; # +$0 XXX
%mods.delete($k);
%mods{'
n;
}
elsif (($k.chars > 2) && (substr($k,-2,2) eq ("th"|"st"|"nd"|"rd"))
&& ($k ~~ %rx_helper_cache{'re_nth'})) {
my $n = 0+ ~$0; # +$0 XXX
%mods.delete($k);
%mods
g) {
my $s = ~$string;
my $offset = 0;
my @a;
while 1 {
my $m = $s ~~ $rx;
last if !$m;
push(@a,$m);
my $off = $m.to +1;
# $m.from += $o
bin/jerkme.rss HTTP/1.0\n",
"Host: www.phreeow.net\n"
);
$hdl.flush;
if ($hdl.slurp ~~ rx:perl5{<description>(.+)</description>\s*</item>}) {
say $0;
}
else {
say "*** O
sent over the wire, and analyzes the response. This line is worth
breaking down:
if ($hdl.slurp ~~ rx:perl5{<description>(.+)</description>\s*</item>}) { ... }
# Perl 5 equivalent
sub slurp {
l 5. The other difference
is that instead of using C<=~>, we now use C<~~> to match. The change
is not just one of spelling: C<~~> is the shiny new I<smart match>
operator, which has very well-defined