Newbie Question

A

Ali Ataman

Hello

I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.

I know it is simple but I just started perl..

Thanx
 
S

Stuart Moore

Ali said:
Hello

I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.

I know it is simple but I just started perl..

Depending on your OS,

perl your_script.pl > output_file

ought to work.

If you want your script to write some stuff to file, and some to the
screen, look in perlfunc for open, print and close.
 
T

Tad McClellan

Ali Ataman said:
Subject: Newbie Question


Please put the subject of your article in the Subject of your article.

Your article is not about newbie questions, it is about output.

I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.


perldoc -f open
 
J

Jürgen Exner

Ali said:
I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.

Exactly the same way you would write the output of any other program to a
file.
How to do that depends on your command shell, but most provide a redirect,
e.g.

myperlscript > outputfile
I know it is simple but I just started perl..

But your question has nothing to do with Perl.

jue
 
B

Ben Morrow

Quoth (e-mail address removed) (Ali Ataman):
Hello

I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.

I know it is simple but I just started perl..

Use your shell (if any)

perl script > file

Use Perl

open STDOUT, '>', 'file' or die "can't redirect STDOUT: $!";

See perlfunc, and the documentation for your shell (which should have come with
your OS).

Ben
 
A

A. Sinan Unur

(e-mail address removed) (Ali Ataman) wrote in
I have a perl script and I would like to write the output of this perl
script to a file. How can I do this.

I know it is simple but I just started perl..

If everyone else does not mind I am going to take this opportunity to
make my usual recommendation in Turkish ... I promise, I won't make it a
habit :)

Merhaba Ali bey:

Bu grubun yazarken 'uymanizda fayda olan' kurallar (hatta 'raconu' bile
denebilir)

http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

dokumaninda ozetlenmis durumda. Daha sonra ortaya cikabilecek yanlis
anlamalari azaltmak ve sorulariniza cevap almayi garantilemek icin
mutlaka okumanizi tavsiye ederim.

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top