Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by roboticus (Canon)
on Feb 27, 2013 at 12:34 UTC ( #1020876=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: How can one get the result to a text file when print join is used?
Select or Download Code
Re^2: How can one get the result to a text file when print join is used?
by clueless newbie (Hermit) 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 (Scribe) on Feb 28, 2013 at 07:07 UTC

    Hi roboticus,

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

    Regards

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020876]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-12-28 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls