Help for this page

Select Code to Download


  1. or download this
    sub pad {
      my $char = pop;
    ...
      $char = " " unless defined $char;
      $_[0] .= $char x ($max - length $_[0]);
    }
    
  2. or download this
        pad($v, 30, 'x');    # $v is now 30 characters long
        print $v;