Help for this page

Select Code to Download


  1. or download this
    $x = \substr("blah", 1, 2);
    $y = \substr("florp", 1, 3);
    print "$$x $$y\n";
    
  2. or download this
    sub substrref { \substr($_[0], $_[1], $_[2]) }
    $x = substrref("blah", 1, 2);
    $y = substrref("florp", 1, 3);
    print "$$x $$y\n";
    
  3. or download this
    sub substrref { eval '\substr($_[0], $_[1], $_[2])' }
    $x = substrref("blah", 1, 2);
    $y = substrref("florp", 1, 3);
    print "$$x $$y\n";