File: demo_userdef.pl

package info (click to toggle)
libperl6-form-perl 0.090-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 584 kB
  • sloc: perl: 3,080; makefile: 8
file content (26 lines) | stat: -rwxr-xr-x 952 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Perl6::Form;

$ID = 10565263827;
$retail = 173.87;
$disc = $retail * .95;
$tax = $retail * .12;

$desc = "3.5 in. closed length. Translucent ruby handle. Features, large & small blades, corkscrew, can opener with small screwdriver, bottle opener with large screwdriver, Perl interpreter, wire stripper, reamer, key ring, tweezers, toothpick, plus 12 other features.";

sub stars {
    my ($match,$opts) = @_;
    $opts->{fill}='*';
    return '{*>>{'.length($match).'}>.<}';
}

print form
	{field=>[qr/(\*+)/=>\&stars], interleave=>1},
    <<'.',
=================[ Quote for item: {>>>>>>>>>>>>>>>>} ]=================

      Retail: **********        Desc: {:<<<<<<<<<<<<<<<<<<<<<<<<}
  Discounted: **********              {:<<<<<<<<<<<<<<<<<<<<<<<<}
         Tax: **********              {:<<<<<<<<<<<<<<<<<<<<<<<<}
                                      {:[[[[[[[[[[[[[[[[[[[[[[[[}
.
      $ID, $retail, $desc, $disc, $desc, $tax, $desc, $desc;