in reply to Re: Read two values from input
in thread Read two values from input
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]\";"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Read two values from input
by TJPride (Pilgrim) on Nov 28, 2011 at 05:24 UTC |