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. Advertisements

  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. Advertisements

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,903
  2. lovecreatesbeauty

    How to know two lines are a pare parallel lines

    lovecreatesbeauty, Apr 27, 2006, in forum: C Programming
    Replies:
    11
    Views:
    859
    Old Wolf
    Apr 28, 2006
  3. Replies:
    1
    Views:
    593
    Jonathan Mcdougall
    Dec 6, 2005
  4. Murali
    Replies:
    2
    Views:
    766
    Jerry Coffin
    Mar 9, 2006
  5. Ron Brennan
    Replies:
    5
    Views:
    602
    Dr John Stockton
    May 14, 2004
  6. Dave

    multiple changes on multiple lines

    Dave, Apr 2, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    226
    Gunnar Hjalmarsson
    Apr 2, 2005
  7. Cah Sableng
    Replies:
    0
    Views:
    403
    Cah Sableng
    Apr 23, 2007
  8. paviinelec
    Replies:
    0
    Views:
    408
    paviinelec
    Apr 3, 2013
Loading...