However, you may have heard the (boastful) observation "Perl makes hard things, easy." It seems to me you've done the reverse (or at least, unnecessarily complicated the code) by introducing the sub.
But how about keeping the code simple:
perl -e "my $inp = <>;@input = split /[\s,]+/, $inp; print \"$input[0] : $input[1]\";"In reply to Re^2: Read two values from input
by ww
in thread Read two values from input
by knils_r00t
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |