Help for this page

Select Code to Download


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