Results 1 to 2 of 2

Thread: getting input in perl

  1. #1
    Join Date
    Feb 2011
    Lubuntu 16.04 Xenial Xerus

    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?
    Living creatures should not be treated as if they are 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


Posting Permissions

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