Help for this page

Select Code to Download


  1. or download this
    my @nums = $x =~ /(\S+)/g;
    
  2. or download this
    my @nums = split(' ', $x);
    
  3. or download this
    # @nums = ('1', '11', '2', '22', '222', '3', '33');
    my @nums = $x =~ /(\d+)/g;
    
  4. or download this
    # @nums = (['1', '11'], ['2', '22', '222'], ['3', '33']);
    my @nums = map { [ /(\d+)/g ] } $x =~ /(\S+)/g;
    
  5. or download this
    # @nums = ('2', '22', '222');
    my @nums = ($x =~ /\s(\S+)/)[0] =~ /(\d+)/g;
    
  6. or download this
    # @nums = ('2', '22', '222');
    my @nums = (split(' ', $x, 3))[1] =~ /(\d+)/g;