Help for this page

Select Code to Download


  1. or download this
    multi sub trim($str) {
        # return modified value
    ...
    multi sub trim($str is rw) {
        # modify in place
    }
    
  2. or download this
    subtest 'trim' => sub {
        is("leading", trim("   leading"), "trim: leading");
    
  3. or download this
    $ perl -we 'use Test::More tests => 1; is "leading", " leading", "trim
    +: leading"'
    1..1
    ...
    #          got: 'leading'
    #     expected: ' leading'
    # Looks like you failed 1 test of 1.