in reply to Re^3: Read CSV with column mapping
in thread Read CSV with column mapping
I have tried adding if conditions as shown in following code but it is not skipping to add comment line and empty line. Am I doing something wrong?
config filewhile(my $colref = $csv->getline ($csv_fh)) { if (scalar(@$colref) =~ /^#/) { last; } if (scalar(@$colref) =~ /^s+$/) { last; } $output_hash{shift @{$colref}} = $colref; }
#ksjlasjda abc xyz,10 xyz pqr,2 pqr stq,0.1
In Section
Seekers of Perl Wisdom