You accidentally replied just to me, not to the list. Please don't do that. Send all messages to the list and I will read them there, along with all the other helpful list subscribers.

On Fri, 14 Oct 2005, Sreedhar reddy wrote:

I tried like this...

INPUT = fopen("filename");
OUTPUT   -- I opened another file here to write output

while(<INPUT>) {
chomp @_;
@strings = split(@_, " ");
print OUTPUT strings[1] + strings[0];
}


But I got error [message]...Can [you] modify this program if it is correct???

If it's correct, it doesn't need to be modified, does it? :-)

If you want help with your errors, you need to *tell us what the error message was*!

Is the text above literally what you wrote? If so, it can't work -- INPUT isn't a valid variable name (it needs to have a 'sigil', like $, @, or %) and the "OUTPUT -- I..." line just looks like a comment. I assume that isn't really your code, is it?

Please show the list exactly what you're doing and what's happening when you try to do it: what the exact statements are to declare your input and output files are, what the while{} loop is (this appears complete, but I want to be sure), and what the error message was.



--
Chris Devers

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to