Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Printing the header row

by martin (Pilgrim)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-08-31 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls