"I used your example and added file references but the script is not outputting all of the rows."
You haven't shown any input or output!
I am unable to reproduce your problem using your code above (with just the filenames changed). My script (pm_csv_to_psv_fhs.pl) has:
my $FileIn = './pm_csv_to_psv_fhs.in';
my $FileOut = './pm_csv_to_psv_fhs.out';
Here's a verbatim run showing input and (before and after) output:
ken@ganymede: ~/tmp
$ cat pm_csv_to_psv_fhs.in
a,b,"c,d",e
"f,g,h",i,j,"k,l"
m,n,o,p,q,r,s,t
"u,v,w,x,y,z"
ken@ganymede: ~/tmp
$ cat pm_csv_to_psv_fhs.out
cat: pm_csv_to_psv_fhs.out: No such file or directory
ken@ganymede: ~/tmp
$ pm_csv_to_psv_fhs.pl
ken@ganymede: ~/tmp
$ cat pm_csv_to_psv_fhs.out
a|b|c,d|e
f,g,h|i|j|k,l
m|n|o|p|q|r|s|t
u,v,w,x,y,z
ken@ganymede: ~/tmp
$
Please show equivalent information for a run of your script.
Here's some other points to consider: all documented in open.
-
Check if you're successfully opening the files: open ... or die "Can't open ...: $!";
-
You've used the recommended 3-argument form for the input file. Why not for the output file?
-
The mode for the output file is '+>'. Why? Perhaps you wanted append mode ('>>') or read-write mode without clobbering the file first ('+<').
-
You only show code for writing to the output file. If you really do want read-write mode, where's the code for the reading part?
Given you're new to Perl, you may be finding the documentation for open to be a little heavy going. If so, read perlopentut first - it provides a gentler introduction to the subject.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.