# New Ticket Created by  Colin Kuskie 
# Please include the string:  [perl #44321]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44321 >


The attached patch marks the 3rd argument of substr as optional so the 2 
argument version of substr will work.

                   
Index: languages/perl6/src/builtins/string.pir
===================================================================
--- languages/perl6/src/builtins/string.pir     (revision 20402)
+++ languages/perl6/src/builtins/string.pir     (working copy)
@@ -191,10 +191,18 @@
 
 .sub 'substr'
     .param string x
-    .param int start
-    .param int len
+    .param int    start
+    .param int    len :optional
+
+    unless len goto end_of_string
+
     $S0 = substr x, start, len
     .return ($S0)
+
+  end_of_string:
+    $S0 = substr x, start
+    .return ($S0)
+
 .end
 
 

Reply via email to