Help for this page

Select Code to Download


  1. or download this
    my $string = "1 3 5 7 11 13";
    my @numbers = split /\s+/, $string;
    
  2. or download this
    my $string = "1 3 5 7 11 13";
    foreach my $number ( split /\s+/, $string ) {
    ...
        # Number will contain one number from the list each time
        # through the loop.
    }