but unable to print it to the a outputfile
It works for me at my unix prompt. It creates "outputfile.log" with these contents:
aaa,1 bbb,2 ccc,3 SUCCESS aaa : a 3 : 1 bbb
It also prints this output with warnings:
aaa,1 bbb,2 ccc,3 ac 1,a 3,b 2,c Argument "1 bbb" isn't numeric in numeric eq (==) at z line 20, <FHAC> + line 1 (#1) (W numeric) The indicated string was fed as an argument to an oper +ator that expected a numeric value instead. If you're fortunate the me +ssage will identify which operator was so unfortunate. readline() on closed filehandle FHAC at z line 20 (#2) (W closed) The filehandle you're reading from got itself closed so +metime before now. Check your control flow. SUCCESS aaa : a 3 : 1 bbb

Please edit your post using code tags around your code and data. See Writeup Formatting Tips. Also post the output and any warning messages you get.

Update: simplify your code to see if you can write to a file, and use autodie:

use strict; use warnings; use diagnostics; use autodie; open( OUTFH, ">outputfile.log" ); print OUTFH "here is some output\n"; print OUTFH "here is more output\n"; close(OUTFH);

In reply to Re: Unable to write to file by toolic
in thread Unable to write to file by vasavi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.