Hi, here are several ways to get in touch with us:
http://perl6.org/community/

If you want immediate answers then IRC is your choice.
Mailing lists do not always deliver immediatly, sometimes it takes two
days for me to reveive mails that way...

  my regex test { <[a..z]>+ }; say "abc123" ~~ / <test> /
  OUTPUT«?abc?? test => ?abc???»

  my regex test { <[a..z]>+ }; say "abc123" ~~ m/ <test> /
  OUTPUT«?abc?? test => ?abc???»

  my regex test { <[a..z]>+ }; my $x = "abc123"; $x ~~ s/ <test> /ohh?/;
say $x
  OUTPUT«ohh?123?»

You can also put it in a variable, but you will notice that it does not
capture:

  my $test = / <[a..z]>+ /; say "abc123" ~~ / <$test> /
  OUTPUT«?abc???»

  my $test = anon regex { <[a..z]>+ }; say "abc123" ~~ / <$test> /
  OUTPUT«?abc???»

But you can always capture (or alias) explicitly be doing:

  my $test = anon regex { <[a..z]>+ }; say "abc123" ~~ / <test=$test> /
  OUTPUT«?abc?? test => ?abc???»

I hope that helps.

Cheers, FROGGS

Am 21.05.2014 20:28, schrieb Schwenn, Peter:
> Dear Perl6ers,
>
> I originally reported this as a bug, which it is probably not.  Where
> should I address a user's (my) questions about specific perl6
> programming.  I saw a link for such a link once upon a time but have
> forgotten where.
>
> Thank you,
>
> Peter Schwenn
>
> Adv. Marine Tech Ctr
> Stevensville, MD
>
> -------------------------------------------------------------------------------------------------------------------------------
>
> my question was:
>
> (how to use a predefined regex pattern):
>
> S05 gives an example of a predefined pattern syntax:
>      $var = / pattern /;     and indicates that it is to be used in
> matching as
>      <$var>     but doesn't give an example. How would it
> be included in a    ~~ m/.../;     or a     ~~ s/...//; ?
>
> I've tried variations of   $str ~~ s/ <$var> /.../;  without any luck.
>
> (perhaps <$var> cannot be used in a m/ or s// construction; perhaps
> there's an alternative for m/ and s//)
>
> Thank you,
>
>  peter schwenn
>
>

Reply via email to