$?OS eq 'os2' );
&readlink := { undef } if $dosish;
unless ( ( $script ~~ m:P5 [/] || ( $dosish && $script ~~ m:P5 [\\] ) )
&& -f $script )
{
for File::Spec.path(
sub hashify (Str $spec is copy) returns Hash {
my @with_args = $spec ~~ rx:P5:g/([^:]):/;
my @without_args = $spec ~~ rx:P5:g/([^:])(?!:)/;
#@with_args.perl.say;
(map { ;~$_ => 0 }, @
or $rev.attributes.kv -> $k, $v is copy {
$v ~~ s:perl5:g{\\}{\\\\};
$v ~~ s:perl5:g{"}{\\"};
$v ~~ s:perl5:g{\015}{};
$v ~~ s:perl5:g{\n}{\\n};
$v ~~ s:perl5:g{ }{\\t};
say qq( $k: "$v");
ormat first.
if $path ~~ s/ \{ (\w+) \} $// {
$.mode = ~$0;
}
else {
$.mode = 'view';
}
if $path ~~ s/ \. (\w+) $// {
ailing slash, if any.
$path ~~ s:g{^/|/$}{};
# A leading [NUM] with no name indicates the root revision to use.
if $path ~~ s{^ \[ (\d+) \] /?}{} {
f the path
if $path {
for split '/', $path -> $comp {
$comp ~~ /^ (\w+) [ \[ (\d+) \] ]? $/
or WWW::Kontent::error("Invalid component '$comp'",
agepath.format}.new()
unless $.renderer;
$output=$.renderer.render($r);
#};
if $! ~~ /^\[restart\]/ {
if $depth < 8 {
$r.go($depth+1);
}
else {
$.status = 504;
$.
ext/plain';
return "Error: restart limit exceeded--possible restart loop";
}
}
elsif $! ~~ /^\[(\d\d\d)\] (.*)/ {
$.status = $0;
$.type = 'text/plain';
return "Error: $1";
}
ursor.parent;
}
}
}
my $pathobj=WWW::Kontent::Path.new().parse($path);
if $path ~~ m{^/} {
# Full path--just resolve from the root page.
try { $pathobj.resolve($.root, $se
ext = $origtext;
say $ERR: "Parsing $origtext.chars() chars of text" if $PROGRESS;
while $text ~~ $parser_regex {
my($chunk, $tag)=(~$0, ~$1);
my $length = "$0$1".chars;
$pos += $length;
chunk.chars() literal chars followed by tag '$tag'" if $PROGRESS;
if $chunk.chars {
$chunk ~~ s:g{\s+}{ };
@stack[-1].add_text($chunk);
}
given $tag {
when "\\\\" {
# nothing
}
if $text.chars {
say $ERR: " $text.chars() literal chars left over" if $PROGRESS;
$text ~~ s:g{\s+}{ };
$base.add_text($text);
}
return $base.children;
}
my sub do_list($skel, $type, $
|
|-----------------------------------|
| ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |~~
$comments,
===================================
.
write STDOUT;
in Perl 6 we
har><1,$width>) /;
# Squeeze the resultant substring...
(my $result = $1) ~~ s:each/ <$ws> | \v+ /\c[SPACE]/;
# Check for any more data still to come...
r:
sub expurgate (Str *@hidewords) {
return sub (Str $data is rw) {
$data ~~ s:ei/(@hidewords)/$( 'X' x length $1 )/;
return $data;
}
}
We could then
C<when> statement, because:
when $is_sheep { push @sheep, $_ }
is equivalent to:
if $_ ~~ $is_sheep { push @sheep, $_; next }
When C<$is_sheep> is a subroutine reference, that implicit sm
my $context = want;
if $context ~~ List {
my @values = block();
return { *@values };
}
elsif $context ~~ Scalar {
my $value = block();
=item * C<=~> becomes the "smart match" operator C<~~>, with a whole new set
of semantics. Anywhere you used C<=~> before you now use C<~~>, but C<~~> is
much more general now. See L<Synopsis 4> for
<=~> >> macro which always fails at
compile time with a message directing the user either to use C<~~> or C<~=> instead,
or to put a space between if they really wanted to assign a stringified value.)
smartmatches the
endpoints in the domain of the object being matched, so C<< 1.5 ~~
1^..^2 >> is true. (But C<< 2.1 ~~ 1..2 >> is false.)
=item * The unary C<^> operator generates a range from C<0>
$dir;
for $dir.readdir.sort:{numerically} -> $fn {
my ($pugsrev, $parserrev) = $fn ~~ /(\d+)-(\d+)/ err next;
next if $XXX_handwaving($pugsrev, $parserrev); # against %?CONFI
IL::Util::Pad $.parent;
has Str @.names;
method lookup_pad($name) {
if (grep { $_ ~~ $name }, @.names) {
self;
}
else {
$.parent ?? $.parent.lo
$var_name, $var_value {
my Str $var_value_as_str = $var_value // $EMPTY_STR;
$text ~~ s:g/\<$var_name\>/$var_value_as_str/;
}
return $text;
}
################################
use v6-alpha;
use Test;
plan 1;
use Text::Glob;
my $regex = Text::Glob.new.glob_to_regex('*.pm');
ok 'Glob.pm' ~~ $regex, 'glob_to_regex works';
in32 mingw msys cygwin> {
$redir_pre = ">";
$redir_post = "";
};
my $file = $?FILE;
$file ~~ s:P5/output.t/script.pl/;
my $cmd = "$*EXECUTABLE_NAME $file $redir_pre $out_fn $redir_post";
%*EN
er indicates language pref as command line argument
my Str @user_lang_prefs = @*ARGS.grep:{ $_ ~~ m/^<[a-zA-Z]>+$/ };
@user_lang_prefs = 'Eng'
if @user_lang_prefs == 0;
my Locale:
my $src = "";
while $_ = =<> {$src ~= $_;}
my $m = $src ~~ rx/oo/;
say "(mapcar 'delete-overlay (overlays-in (point-min) (point-max)))";
say "(overlay-put (make-overlay {$m.from +1} {$m.to +1} nil
item) returns Str {
my $str_item = ~$item;
$str_item ~= $item.WHICH()
if $str_item ~~ rx:perl5/^\<obj\:/; #/#cperl-mode--
return $str_item;
}
method insert($self: *@items) returns
b *infix:<~~> (Set $one, $member) returns Bool {
$one.includes($member);
}
# XXX -- IIRC, there's a "is commutative" or such, so duplicating shouldn't be
# necessary.
multi sub *infix:<~~> ($membe
"This should never happen"}
default {
my @index = split('',$didget);
@index = grep {$_ ~~ /^<[A..Za..z0..9+\/=]>+$/},@index;
[~] map {chr ($_)}, decode(@index)}
}
}
# 1716151
er indicates language pref as command line argument
my Str @user_lang_prefs = @*ARGS.grep:{ $_ ~~ m/^<[a-zA-Z]>+$/ };
@user_lang_prefs = 'Eng'
if @user_lang_prefs == 0;
my Locale:
d y $& ab
a(?{"{"}})b - c - Unmatched right curly bracket
a(?{$bl="\{"}).b caxbd y $bl {
x(~~)*(?:(?:F)?)? x~~ y - -
^a(?#xxx){3}c aaac y $& aaac
'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
(?<![cd])b d