Jason Cruces wrote:
> 
> Hello all,
> Probably are really simple one but haven't found the
> answer yet. In an interactive program, where a user is
> prompted to enter more than one value, I would use
> 
> chomp(@values = <STDIN>);
> 
> And to terminate the input, enter Ctrl-D (or Ctrl-Z on
> windows).
> My question is, how would I change the terminating
> characters (Ctrl-D) to the user just hitting the enter
> key (or any other character)?
> I tried a do/until statement like
> do{
> $i=0;
> chomp($value[$i] = <STDIN>).
> $i++;
> }until (! $value[$i]);
> 
> but still not having much luck. Any ideas?

Something like this will work:


my @value;

for ( ;; ) {
    my $temp = <STDIN>;
    last if $temp eq "\n";
    push @value, $temp;
    }



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to