in reply to a simple work task

Read from STDIN.
chomp( my $line = <STDIN> ); print "You typed '$line'.\n";

Replies are listed 'Best First'.
Re^2: a simple work task
by polycomb (Initiate) on Jan 14, 2011 at 20:11 UTC
    three inputs is like: jar, 2, 200 or separate by tab
Re^2: a simple work task
by polycomb (Initiate) on Jan 14, 2011 at 19:37 UTC

    how to store three inputs on same line into three scalar variable?

    and loop on several lines of inputs?
      how to store three inputs on same line into three scalar variable?
      split
      and loop on several lines of inputs?
      open a file, or...
      while (<>) { # do something }
      See also perlintro

      You may be looking for something like this:

      ... print "Please enter RNAi name, concentration, volume: (empty line to +continue)\n"; while ((my $line = <STDIN>) ne "\n") { chomp $line; my ($name, $conc, $vol) = split ' ', $line; # split by whitespace $RNA{$name} = $conc; $vol{$name} = $vol; } ...