in reply to Re: iterative foreach loop
in thread iterative foreach loop

for my $newline (@lines) { printf $newline; # print the contents of the filled array }

This seems confusingly verbose to me. Why not simply

print @lines;

There's no need for printf, for an explicit loop or for a lexical scalar. TIMTOWTDI, but there is clarity in simplicity.

Replies are listed 'Best First'.
Re^3: iterative foreach loop
by zarath (Beadle) on Nov 15, 2017 at 11:38 UTC

    Good points, thanks for that!

    I think I picked up some bad habits by learning Perl mainly from some old scripts I've come across at work.

    Starting to think the guy who wrote them shouldn't have...