http://www.perlmonks.org?node_id=1020876


in reply to How can one get the result to a text file when print join is used?

supriyoch_2008:

If you want your output to go to the file, you need to say so. Change this:

print join("", @res);

to this:

print FH join("", @res);

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: How can one get the result to a text file when print join is used?
by clueless newbie (Curate) on Feb 27, 2013 at 12:45 UTC

    Or add a "select FH;" after the "open (FH...")

    open(FH, ">myPer .txt") or die "Cannot open myPer .txt"; select FH;

      Hi clueless newbie,

      Thanks for the code. It has worked and my problem is now over. The code is unique and simple.

      With deep regards,

Re^2: How can one get the result to a text file when print join is used?
by supriyoch_2008 (Monk) on Feb 28, 2013 at 07:07 UTC

    Hi roboticus,

    Thanks for the code. It has worked nicely and solved my problem.

    Regards