Advertisement
Guest User

Untitled

a guest
Oct 17th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.50 KB | None | 0 0
  1. this one returns an error when I'm running it:
  2.  
  3.  
  4. sub m1(%h(:$arg1?, :$arg2?)) {
  5.  say %h;
  6. }
  7.  
  8. m1(arg1 => "some arg1"); # => "Too few positionals passed; expected 1 argument but got 0 in sub m1"
  9.  
  10.  
  11.  
  12.  
  13. When I remove the whitespace:
  14.  
  15.  
  16. sub m1(%h(:$arg1?, :$arg2?)) {
  17.  say %h;
  18. }
  19.  
  20.  
  21. it returns the error "Shape declaration with () is reserved; please use whitespace if you meant a subsignature for unpacking, or use the :() form if you meant to add signature info"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement