in reply to Split and Pattern Match

Does "1 word here another word" mean you have word pairs like "foo bar", "baz quux", or "foo bar baz quux"? Assuming the former, you can break that up like so:

my $var = "foo bar"; my @vals = split ' ', $var; # if you need something more complex, use +a regex for the pattern

Note that if you split on the whitespace it will already be stripped from the returned strings, so no extra processing should be necessary. For the second question, a match will do the trick:

foreach my $val (@vals) { print "Numeric\n" if $val =~ /^[0-9]{2}/; }

Alternatively you could use substr.


"The dead do not recognize context" -- Kai, Lexx