Hello again leelu,
The monks are happy to help you, but you need to meet us half-way. First, please follow wrog’s advice and format your post using paragraph and code tags:
<p>First paragraph</p>
<code>
use strict;
use warnings;
...
close( $f2 ); #close output file handle
}
</code>
<p>Final paragraph</p>
See:
Second, please follow afoken’s advice and post actual code. The code you have posted does not compile:
- The $ sigil is missing from the first occurrence of $f1.
- You have use strict but no declarations for the variables $results, @fields, $flag, and $inputdata.
- The line print James|chicago "\n"; contains unquoted text; likewise the line print already $inputdata exists"\n";.
Third, you say you are “getting error during while condition,” but don’t explain what that error is. Please see:
and be sure to show the output you want to see, and exactly how it differs from the output you do see.
Hope that helps,
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.