use strict; use warnings; my $inp = getInput('Enter two values'); $inp = [split /[\s,]+/, $inp]; print "Values entered are: $inp->[0], $inp->[1]\n"; sub getInput { my $inp; while (1) { print "$_[0]: "; chomp($inp = <STDIN>); return $inp if $inp; } }
In reply to Re: Read two values from input
by TJPride
in thread Read two values from input
by knils_r00t
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |