in reply to Re: a simple work task
in thread a simple work task

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

and loop on several lines of inputs?

Replies are listed 'Best First'.
Re^3: a simple work task
by toolic (Bishop) on Jan 14, 2011 at 19:42 UTC
    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
Re^3: a simple work task
by Anonyrnous Monk (Hermit) on Jan 14, 2011 at 19:51 UTC

    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; } ...