> INPUT = fopen("filename"); > OUTPUT -- I opened another file here to write output
These two lines r just to say how I'm proceeding... The err msg which I got is... "Can't modify constant item in scalar assignment at test_script.pl line 1, near " );" syntax error at test_script.pl line 13, near "strings[" Execution of test_script.pl aborted due to compilation errors." Can u tell me wht is meant by this ? Thanks, Sridhar -----Original Message----- From: Chris Devers [mailto:[EMAIL PROTECTED] Sent: Friday, October 14, 2005 6:59 PM To: Sreedhar reddy Cc: beginners@perl.org Subject: RE: I need help here 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>