File: strip_ws.t

package info (click to toggle)
libmethod-signatures-perl 20170211-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 672 kB
  • sloc: perl: 3,860; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -lw

package String;
use Method::Signatures;

method strip_ws($str is alias) {
    $str =~ s{^\s+}{};
    $str =~ s{\s+$}{};
    return;
}

my $string = " stuff  ";
print "String was: '$string'";
String->strip_ws($string);
print "String is:  '$string'";