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]

Reply via email to