in reply to Code that copy's multiple times a $ from a document
Using GotToBTru dataset, one can simply do this:
Outputuse warnings; use strict; while (<DATA>) { my $val = [split]; print map { sprintf "%d - %d %s\n" => $val->[0], $_, $val->[2] } +( 1 .. $val->[1] ); } __DATA__ 1 2 tt 2 3 aa 3 1 dd
1 - 1 tt 1 - 2 tt 2 - 1 aa 2 - 2 aa 2 - 3 aa 3 - 1 dd
|
|---|