reading output file data as input data

S

Stephen Moon

At the command prompt,

I type "perl test.pl <file1> <file2> <file3>" to run the program.

Initially, I open <file1> as an input file and output the information
to <file2>. Later on in the same program, I use <file2> as an input
and write the output to <file3>.

I get an error saying that "filehandler FH opened for output only"
although I close the <file2> and reopen it with a new filehandle.

-Steve
 
T

Tad McClellan

Stephen Moon said:
At the command prompt,

I type "perl test.pl <file1> <file2> <file3>" to run the program.

Initially, I open <file1> as an input file and output the information
to <file2>. Later on in the same program, I use <file2> as an input
and write the output to <file3>.

I get an error saying that "filehandler FH opened for output only"
although I close the <file2> and reopen it with a new filehandle.


There is an error on line 42.
 
B

Beable van Polasm

At the command prompt,

I type "perl test.pl <file1> <file2> <file3>" to run the program.

Initially, I open <file1> as an input file and output the information
to <file2>. Later on in the same program, I use <file2> as an input
and write the output to <file3>.

I get an error saying that "filehandler FH opened for output only"
although I close the <file2> and reopen it with a new filehandle.

There's probably something wrong with your program "test.pl".


--
 
S

Stephen Moon

Tad McClellan said:
There is an error on line 42.

well, actually there is an error on line 45:)
I will look into more and try to figure out.

In C, there is a way to make a file readable, writable, appendable, etc.
Is there a way to do the same in perl in the Windows environment?

-Steve
 
K

ko

Stephen said:
well, actually there is an error on line 45:)
I will look into more and try to figure out.

You're missing the point. There are lots of people willing to help, but
with the limited description given and lack of any code whatsoever its
difficult to see what's going on - except for those who have figured out
how to use the PSI::ESP module :)
In C, there is a way to make a file readable, writable, appendable, etc.
Is there a way to do the same in perl in the Windows environment?

'perldoc perlopentut' from your shell. The documentation covers the many
ways to open files in Perl.

HTH - keith
 
T

Tad McClellan

Stephen Moon said:
In C, there is a way to make a file readable, writable, appendable, etc.
Is there a way to do the same in perl in the Windows environment?


Yes.

You open files in Perl using the appropriately named open() function.

Perhaps the documentation for that function might help...


perldoc -f open



Your articles may become invisible if you don't stop asking us
to read the documentation for you...
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top