Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by roboticus (Chancellor)
on Feb 27, 2013 at 12:34 UTC ( [id://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.

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found