# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130910]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130910 >


Here are 3 examples that work as expected:

Code:
my regex meh($t) { xy }; say 'xy' ~~ /^ <meh(42)> $/

Result:
「xy」
 meh => 「xy」


Code
my regex meh($t) { xy }; say 'ab' ~~ /^ <meh(42)> $/

Result:
Nil


Code:
my regex meh($t) { .. }; say 'xy' ~~ /^ <meh(42)> $/

Result:
「xy」
 meh => 「xy」



And here is one that doesn't:

Code:
my regex meh($t) { .. }; say 'xyz' ~~ /^ <meh(42)> $/

Result:
Too few positionals passed; expected 2 arguments but got 1
  in regex meh at <tmp> line 1
  in block <unit> at <tmp> line 1



Why? What second argument is it expecting?
Nil is the right answer here.

Reply via email to