B
billy
I am writing some code that write some more code.
example:
my (%h1,%h2,%h3);
# assume each hash has 100 widgets
foreach $h1 (keys %h1)
print <<P1;
print some stuff
P1
foreach $h2 (keys %h2)
print <<P2;
print some stuff
P2
foreach $h3 (keys %h3)
print <<P3;
print some stuff
P3
} # loop p3
} # loop 2
} # loop 1
What I would like is to eliminate the 3 PN to just one
print <<P1
foreach blabla But don't print the foreach loop, just loop.
P1
foreach \$h1(keys \%h1)
{
a(\$h1);
b(\$h1);
c(\$h1);
P1
foreach
example:
my (%h1,%h2,%h3);
# assume each hash has 100 widgets
foreach $h1 (keys %h1)
print <<P1;
print some stuff
P1
foreach $h2 (keys %h2)
print <<P2;
print some stuff
P2
foreach $h3 (keys %h3)
print <<P3;
print some stuff
P3
} # loop p3
} # loop 2
} # loop 1
What I would like is to eliminate the 3 PN to just one
print <<P1
foreach blabla But don't print the foreach loop, just loop.
P1
foreach \$h1(keys \%h1)
{
a(\$h1);
b(\$h1);
c(\$h1);
P1
foreach