in reply to Code that copy's multiple times a $ from a document

Using GotToBTru dataset, one can simply do this:

use 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
Output
1 - 1 tt 1 - 2 tt 2 - 1 aa 2 - 2 aa 2 - 3 aa 3 - 1 dd

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me