Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Printing the header row

by martin (Friar)
on Sep 13, 2012 at 15:48 UTC ( #993520=note: print w/ replies, xml ) Need Help??

in reply to Printing the header row

I guess the situation that the first round of an iteration provides information that is valid for all rounds, while not available before the iteration has started, is too unlikely to call for a general pattern.

That said, a way to achieve the same result with slightly prettier code alignment could be:

sub arrayref_to_csvline { ... } my $rows = 0; while (my $row = $iter->()) { print arrayref_to_csvline($row->fields) unless $rows++; print arrayref_to_csvline($row->values); }

Comment on Re: Printing the header row
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993520]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-26 00:59 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls