Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want the value after 'blah::' to be set as a variable to the number. e.g status=22; max=5.blah::status integer:22 blah::max integer:5 ...
This seems very long winded since the arrays can get very big and this method means that I need an if statement for every element. Can you suggest a better way?if ($array[$i] =~ /.*status.*/) { $status = $array1[$i]; $status =~ s/^.*://; } if ($array[$i] =~ /.*max.*/) { $max = $array1[$i]; $max =~ s/^.*://; } ...etc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array problem
by Roy Johnson (Monsignor) on Jun 16, 2004 at 21:41 UTC | |
by Anonymous Monk on Jun 19, 2004 at 13:04 UTC | |
|
Re: Array problem
by jeffa (Bishop) on Jun 16, 2004 at 21:41 UTC | |
|
Re: Array problem
by borisz (Canon) on Jun 16, 2004 at 21:49 UTC |