Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Printing particular column is not working

by fishmonger (Pilgrim)
on Jul 24, 2014 at 13:39 UTC ( #1094914=note: print w/ replies, xml ) Need Help??


in reply to Printing particular column is not working

my @header=<FH>;

That slurps the entire file into the array, not just the first line.

Try: my $header = shift <FH>;

Or: my @header = split(/,/, shift <FH>);

Or the better option as has already been suggested would be to use the Text::CSV module or one of its brethren.


Comment on Re: Printing particular column is not working
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-09-23 23:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls