root/examples/vmethods/num.pl

Revision 11293, 412 bytes (checked in by Darren_Duncan, 3 years ago)

replaced all 'use v6;' lines with 'use v6-alpha;' in 330 files (examples/, ext/, t/, t_disabled/) ... more remain to do

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1# Please remember to update examples/output/vmethods/num if you change this
2# file so its output will change.
3#
4
5use v6-alpha;
6
7multi sub zeros ( Int $value ) {
8    return '0' x $value;
9}
10
11multi sub spaces ( Int $value ) {
12    return ' ' x $value;
13}
14
15multi sub fill_with ( Int $value; Int $string ) {
16    return substr( $string ~ $value, -$string.chars );
17}
18
19say 7.fill_with(3.zeros);
20say 7.fill_with(3.spaces);
Note: See TracBrowser for help on using the browser.