in reply to Easiest way to do something only on first iteration of loop
This is slightly less verbose.
sub display_paragraph() { my $aref = shift; my $indentation = shift; my $skip_first = 0; # declare and init a flag for my $line (@$aref) { if ($skip_first++) { # false first time thru, true thereafte +r print ' ' x $indentation; } print "$line\n"; } }
|
|---|