Group
Extension

Matches 1309

Perl6-Doc ( H/HI/HINRIK/Perl6-Doc-0.47.tar.gz, HINRIK, 2010; MetaCPAN )
Perl6-Doc/share/Synopsis/S04-control.pod ( view source; MetaCPAN )
inst
the current topic.  That is,

    doit() when 42;

is exactly equivalent to

    doit() if $_ ~~ 42;

This is particularly useful for list comprehensions:

    @lucky = ($_ when /7/ for 1..100);
Perl6-Doc ( H/HI/HINRIK/Perl6-Doc-0.47.tar.gz, HINRIK, 2010; MetaCPAN )
Perl6-Doc/share/Magazine/M04-everyday-perl-6.pod ( view source; MetaCPAN )
 $x = $cond ? $true : $false;
 $s = "con" ~ "cat" ~ "enate";   $s = "con" . "cat" . "enate";
 $str ~~ /$pattern/;             $str =~ /$pattern/;

Any time you see a C<~> in Perl 6, it has something t
 
of not knowing the language at all or from knowing Perl 5, it's enough to 
know initially that C<~~> will pattern match on strings).

=head2 New Perl 6 Syntax

Perl 6 also has some brand-new syntax.
Perl6-Doc ( H/HI/HINRIK/Perl6-Doc-0.47.tar.gz, HINRIK, 2010; MetaCPAN )
Perl6-Doc/share/Magazine/M05-yet-another-perl-6-operator.pod ( view source; MetaCPAN )
be expressed as methods or smart 
patterns.

 if $filename.:e { say "exists" }
 # or
 if $filename ~~ :e { say "exists" }

=head2 Junction Operators

Perl 6 introduces a new scalar data-type: the B<ju
Perl6-Doc ( H/HI/HINRIK/Perl6-Doc-0.47.tar.gz, HINRIK, 2010; MetaCPAN )
Perl6-Doc/share/Exegesis/E04.pod ( view source; MetaCPAN )
to provide a generic "smart
match" operator.

So he did. It's called C<=~>.

[Update: Now called C<~~> instead.]

Yes, the humble Perl 5 "match a string against a regex" operator is
promoted in Perl 6
nce

         INCLUSIVE OR             ||                     or
         EXCLUSIVE OR             ~~                    xor
          DEFINED OR              //                    err

[Update: High 
kurila ( T/TT/TTY/kurila-1.19_0.tar.gz, TTY, 2009; MetaCPAN )
kurila/pod/perlsyn.pod ( view source; MetaCPAN )
nalogous
to C<switch> and C<case> in other languages, so the code
above could be written as

    given($_) {
	when (/^abc/) { $abc = 1; }
	when (/^def/) { $def = 1; }
	when (/^xyz/) { $xyz = 1; }
	def

    }

This construct is very flexible and powerful. For example:

    use feature ":5.10";
    given($foo) {
	when (undef) {
	    print '$foo is undefined';
	}
	
	when ("foo") {
	    print '$foo is 
check($foo) is true';
	}
	
	default {
	    die q(I don't know what to do with $foo);
	}
    }

C<given(EXPR)> will assign the value of EXPR to C<$_>
within the lexical scope of the block, so it's simi
Acme-Gtk2-Ex-Builder ( K/KE/KEEDI/Acme-Gtk2-Ex-Builder-0.008.tar.gz, KEEDI, 2011; MetaCPAN )
Acme-Gtk2-Ex-Builder/lib/Acme/Gtk2/Ex/Builder.pm ( view source; MetaCPAN )
);
        }
 
        if ($self->_current && ref($self->_current) ne __PACKAGE__) {
            given (ref $self->_current) {
                when (/Gtk2::VBox|Gtk2::HBox/) {
                    $sel
       given ($key) {
                when ('id') {
                    $self->find($values[0], $self->_current);
                }
                when ('packing') {
                    given (ref $s
Config-TinyDNS ( B/BM/BMORROW/Config-TinyDNS-1.tar.gz, BMORROW, 2011; MetaCPAN )
Config-TinyDNS/lib/Config/TinyDNS.pm ( view source; MetaCPAN )
 _lookup_filt {
    my ($k, @args) = @_;
    my $f = $Filters{$k} or croak "bad filter: $k";
    given (reftype $f) {
        when ("CODE")   { return $f }
        when ("REF")    { return ($$f)->(@ar
try: $k => $f" }
    }
}
    
sub _decode_filt {
    my ($f) = @_;
    defined $f or return;
    given (reftype $f) {
        when ("CODE")   { return $f }
        when (undef)    { return _lookup_fil
;
        my $lo   = sub { $_[0] . (defined $_[1] ? ":$_[1]" : "") };
        sub { 
            given ($_) {
                when ([".", "&"]) { 
                    $repl->(@_[1, 5]);
              
TM ( D/DR/DRRHO/TM-1.56.tar.gz, DRRHO, 2010; MetaCPAN )
TM/lib/TM/AsTMa/Fact.pm ( view source; MetaCPAN )
 s/ \~ /\n/g;             						# replace _~_ with \n
    s/ \~\~ / \~ /g;         						# stuffed ~~ cleanout
    s/^\#.*?\n/\n/mg;        						# # at the start of every line -> gone
    s/\s\#.*?\n
Log-Info ( F/FL/FLUFFY/Log-Info-2.00.tar.gz, FLUFFY, 2010; MetaCPAN )
Log-Info/lib/Log/Info.pm ( view source; MetaCPAN )


  my @keys = keys %{LOG4PERL_LEVELS()};
  my ($minkey, $maxkey) = (min(@keys), max(@keys));

  given ( $level ) {
    when ( $_ < $minkey ) { $l4p_level = 2 * LOG4PERL_LEVELS->{$minkey} }

    when 
MOSES-MOBY ( E/EK/EKAWAS/MOSES-MOBY-0.96.1.tar.gz, EKAWAS, 2010; MetaCPAN )
MOSES-MOBY/lib/MOSES/MOBY/Data/Object.pm ( view source; MetaCPAN )
->toXML ($name);
	$root->appendChild ($xmlElem) if $xmlElem;
    }
}

# return the same value as given (but others may override it - eg,
# Boolean changes here 1 to 'true'

sub _express_value {
    sh
App-QuoteCC ( A/AV/AVAR/App-QuoteCC-0.10.tar.gz, AVAR, 2010; MetaCPAN )
App-QuoteCC/lib/App/QuoteCC.pm ( view source; MetaCPAN )
_flag.
{
my @go_attrs = MooseX::Getopt::GLD->meta->get_attribute_list;
my $help_attr = 'help_flag' ~~ @go_attrs ? 'help_flag' : 'help';
has $help_attr => (
    traits        => [ qw/ Getopt / ],
    c
nextgen ( E/EC/ECARROLL/nextgen-0.06.tar.gz, ECARROLL, 2010; MetaCPAN )
nextgen/lib/nextgen.pm ( view source; MetaCPAN )
	return ()
	## }

	my $procedural = (
		$pkg eq 'main'
		|| defined $args{'mode'} && $args{'mode'} ~~ qr/:procedural/
	) ? 1 : 0
	;

	feature->import(':5.10');
	indirect->unimport(':fatal');
	autodie-
TM ( D/DR/DRRHO/TM-1.56.tar.gz, DRRHO, 2010; MetaCPAN )
TM/lib/TM/IndexAble.pm ( view source; MetaCPAN )

	);
    return %s;
    }
}

sub _expand_axes {
    my $a = shift;
    use feature 'switch';
    given ( $a ) {
	when ('taxo') {                                                              # "taxo" s
TM ( D/DR/DRRHO/TM-1.56.tar.gz, DRRHO, 2010; MetaCPAN )
TM/lib/TM.pm ( view source; MetaCPAN )
rtion_id>, ...)

This method takes a list of assertion IDs and returns the assertion(s) with the given (subject)
ID(s). If the assertion is not identifiable, C<undef> will be returned in its place. Ca
Perl6-Pugs ( A/AU/AUDREYT/Perl6-Pugs-6.2.13.tar.gz, AUDREYT, 2006; MetaCPAN )
Perl6-Pugs/misc/JavaScript-FrontEnd/ARuntime.pm ( view source; MetaCPAN )
 if $proto ~~ JSX::null;
    return $proto.<[[Get]]>($P);
}
# 8.6.2.2
method <[[Put]]> ($O: JSX::String $P, JSX::Value $V) {
    my $Result1 = $O.<[[CanPut]]>($P);
    return if $Result1 ~~ JSX::false
        return JSX::true;
    }
    my $proto = $O.<[[Prototype]]>;
    return JSX::true if $proto ~~ JSX::null;
    return $proto.<[[CanPut]]>($P);
}
# 8.6.2.4
method <[[HasProperty]]> ($O: JSX::Stri
 $O.property_value.exists($P);
    my $proto = $O.<[[Prototype]]>;
    return JSX::false if $proto ~~ JSX::null;
    return $proto.<[[CanPut]]>($P);
}
# 8.6.2.5
method <[[Delete]]> ($O: JSX::String $P
Perl6-Pugs ( A/AU/AUDREYT/Perl6-Pugs-6.2.13.tar.gz, AUDREYT, 2006; MetaCPAN )
Perl6-Pugs/ext/libwww-perl/lib/HTTP/Headers/Util.pm ( view source; MetaCPAN )
 ($value ~~ s:P5/^\s*(=*[^\s=;,]+)//) {
                push @current, ~$0;  # 'token' or parameter 'attribute'
                
                # a quoted value
                if ($value ~~ s:P5/^\s
 = ~$0;
                    $val ~~ s:P5:g/\\(.)/$0/;
                    push @current, $val;
                # some unquoted value
                } elsif ($value ~~ s:P5/^\s*=\s*([^;,\s]*)//) {
   
                 my $val = ~$0;
                    $val ~~ s:P5/\s+$//;
                    push @current, $val;
                # no value, a lone token
                } else {
                    
Games-RailRoad ( J/JQ/JQUELIN/Games-RailRoad-1.101330.tar.gz, JQUELIN, 2010; MetaCPAN )
Games-RailRoad/lib/Games/RailRoad.pm ( view source; MetaCPAN )
th => 'Games::RailRoad::Node', sub_name => 'nodes';
    $_->require for __PACKAGE__->nodes;

    given ( $save->{version} ) {
        when ( $_ > __PACKAGE__->VERSION ) {
            die "uh, loading 
n in vertical /
        # horizontal rails.
        my $frac = $train->frac;
        $frac += $dir ~~ [ qw{ e n s w } ] ? 1/5 : sqrt(2)/10;

        if ( $frac >= 1 ) {
            # eh, changing node
in the middle of two nodes, it's not precise enough.
    $x %= $TILELEN;
    $y %= $TILELEN;
    given ($x) {
        when( $_ >  $TILELEN * (1-$prec) ) { $col++; }
        when( $_ <= $TILELEN * $pre
WWW-Formspring ( W/WO/WORR/Formspring/WWW-Formspring-0.03.tar.gz, WORR, 2010; MetaCPAN )
WWW-Formspring/lib/WWW/Formspring.pm ( view source; MetaCPAN )
)

=item answered_list($username, $max_id, $since_id)

Gets a list of questions and answers from given (or default) username. Returns an arrayref of WWW::Formspring::Response objects.
If max_id parame
Project-Euler ( L/LE/LESPEA/Project-Euler-0.20.tar.gz, LESPEA, 2010; MetaCPAN )
Project-Euler/lib/Project/Euler/Lib/Utils.pm ( view source; MetaCPAN )
e = multiple_check(15, [2, 3, 5], 1);

    my @div_by = multiple_check(15, [2, 3, 5]);
    @div_by ~~ (3, 5) == 1;


    my $num = 3;
    my $is_prime = !multiple_check($num, [2..sqrt($num)]);

=head1
RRD-Daemon ( F/FL/FLUFFY/RRD-Daemon-1.01.tar.gz, FLUFFY, 2010; MetaCPAN )
RRD-Daemon/lib/RRD/Daemon/RRDB/Graph.pm ( view source; MetaCPAN )
----------

sub graph {
  my ($self, $out_fn) = @_;

  my @rras = map $_->rras, $self->rrdbs;

  given ( $self->range || '' ) { # make sure it's defined so when ( /.../ ) doesn't whinge
    when ( '' 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.