using perl to generate a simple report.
Hello All, I've written a very simple script where the user inputs data, from which a report is generated. My problem is that some of this data is in rows and columns and every time the user hits enter to start a new line, the script thinks they are done and moves on to the next part of the script. Can anyone tell me How I can have the user start a new line without terminating this part of the program. What I presently have: print \n\nPlease state below product name and ID code.\n\n; What they would normally input: RAX-23419853 RAX-234b 19854 Thank you, -C -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using perl to generate a simple report.
What is the code you're using to accept the user input? On 2/22/02 1:40 PM, Carlo Sayegh [EMAIL PROTECTED] wrote: I've written a very simple script where the user inputs data, from which a report is generated. My problem is that some of this data is in rows and columns and every time the user hits enter to start a new line, the script thinks they are done and moves on to the next part of the script. Can anyone tell me How I can have the user start a new line without terminating this part of the program. What I presently have: print \n\nPlease state below product name and ID code.\n\n; What they would normally input: RAX-23419853 RAX-234b 19854 Thank you, -C -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using perl to generate a simple report.
On 2/22/02 10:40 AM, Carlo Sayegh [EMAIL PROTECTED] wrote: Hello All, Hi Carlo, I've written a very simple script where the user inputs data, from which a report is generated. My problem is that some of this data is in rows and columns and every time the user hits enter to start a new line, the script thinks they are done and moves on to the next part of the script. Can anyone tell me How I can have the user start a new line without terminating this part of the program. Assuming you're using something like $input = STDIN; chomp($input); to get your data now, you can do this @input = STDIN; chomp(@input); to get an array, with each element corresponding to each line the user entered. Users type ^D (control-d; or their EOF character, if it's not ^D) when they are finished entering data. Note that once you hit return, you can't go back and edit the previous line. Hope that helps, -- Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using perl to generate a simple report.
If he's using Windows, ^Z is the EOF character. -Original Message- From: Michael Kelly [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 12:35 PM To: [EMAIL PROTECTED] Subject: Re: using perl to generate a simple report. On 2/22/02 10:40 AM, Carlo Sayegh [EMAIL PROTECTED] wrote: Hello All, Hi Carlo, I've written a very simple script where the user inputs data, from which a report is generated. My problem is that some of this data is in rows and columns and every time the user hits enter to start a new line, the script thinks they are done and moves on to the next part of the script. Can anyone tell me How I can have the user start a new line without terminating this part of the program. Assuming you're using something like $input = STDIN; chomp($input); to get your data now, you can do this @input = STDIN; chomp(@input); to get an array, with each element corresponding to each line the user entered. Users type ^D (control-d; or their EOF character, if it's not ^D) when they are finished entering data. Note that once you hit return, you can't go back and edit the previous line. Hope that helps, -- Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]