Results 1 to 2 of 2

Thread: getting input in perl

  1. #1
    Join Date
    Feb 2011
    Location
    California
    Beans
    89
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    getting input in perl

    Is there a built-in way to get user input word-by-word (rather than line-by-line) from STDIN in perl, or do I have to code that myself?
    No living creature should be treated as if it were property.

  2. #2

    Re: getting input in perl

    You can fiddle with $/ to change the separator <FILEHANDLE> uses, which is a newline by default (careful changing it as it changes for the entire module -- see here for more details), or you can use Perl's read built-in if you want to do it the hard way.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •