Bryan R Harris <mailto:[EMAIL PROTECTED]> wrote:
: I'd like to snag all the whitespace padded numbers in $_ into an
: array, e.g. in the following:
: 
: 1 "M_fx,-3,+2.p2" -31.4e-1 4.

    Can you give more than one example?

    If everything fits this form, then don't look for numbers.
Just delete strings with starting ".

use strict;
use warnings;
use Data::Dumper 'Dumper';

my $string = ' 1 "M_fx,-3,+2.p2" -31.4e-1 4. ';

my @numbers = grep ! m/^"/, split ' ', $string;

# or my @numbers = ( split ' ', $string )[0, 2, 3];

print Dumper [EMAIL PROTECTED];

__END__


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to