- or download this
chomp( @list = <STDIN> );
print "Item: ", ++$count, ", Value: $_\n" foreach @list;
- or download this
Item: 1, Value: 2
Item: 2, Value: 3
Item: 3, Value: 4
- or download this
Item: 1, Value: 2 3 4
- or download this
chomp( @input = <STDIN> );
push( @list, split( /\s+/, $_ ) ) foreach @input;
foreach ( @list ) {
print "$names[$_-1]\n";
}