Multiple input lines

Discussion in 'Perl' started by Elizabeth Gary, Nov 12, 2003.

  1. How can I enter in multiple input lines to an array? Example:

    Enter your mailing address:

    7660 Eyespy Court
    Clinton, Mississippi 32322

    When I try to do this perl just sits and waits for Ctrl-D or Ctrl-C and
    quits my program.


    Leonard
    Elizabeth Gary, Nov 12, 2003
    #1
    1. Advertising

  2. Elizabeth Gary wrote:
    > How can I enter in multiple input lines to an array? Example:
    >
    > Enter your mailing address:
    >
    > 7660 Eyespy Court
    > Clinton, Mississippi 32322
    >
    > When I try to do this


    What is "this"? How about showing us the code you have so far?

    Anyway, these suggestions might be what you need:

    $address[0] = <STDIN>;

    or

    push @address, scalar <STDIN>;

    This group is defunct, so you'd better use comp.lang.perl.misc instead.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Nov 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack
    Replies:
    9
    Views:
    2,656
  2. Joe Wright
    Replies:
    0
    Views:
    510
    Joe Wright
    Jul 27, 2003
  3. Dave

    multiple changes on multiple lines

    Dave, Apr 2, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    108
    Gunnar Hjalmarsson
    Apr 2, 2005
  4. Cah Sableng
    Replies:
    0
    Views:
    236
    Cah Sableng
    Apr 23, 2007
  5. paviinelec
    Replies:
    0
    Views:
    291
    paviinelec
    Apr 3, 2013
Loading...

Share This Page