in reply to Loop Control
It looks to me like the only difference between your two "blocks" is that when $i == 0 you want your print statement done without a slash, and otherwise it has a slash. Correct? In that case, I'd limit the test to that particular line:
print "$a[$i]", ( $i ? '/' : '' ), "$c1[$w]";
Then the rest of your block doesn't need to be duplicated at all.
Aaron B.
Available for small or large Perl jobs; see my home node.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Loop Control
by slugman (Novice) on Jul 06, 2012 at 00:05 UTC | |
by aaron_baugher (Curate) on Jul 06, 2012 at 02:10 UTC |