in reply to extracting variables from a string

many ways, depending on the assumptions you want to make -- here are a couple:
my $s = "43436 66 78 5333 3444 ... 345ms : 34.56ms : 45ms"; my @vars = $s =~ /([0-9.]+)ms/g; if( $s =~ /(\d+)ms : ([0-9.]+)ms : (\d+)ms/ ){ my @vars = ($1, $2, $3 ); }

Replies are listed 'Best First'.
Re^2: extracting variables from a string
by Anonymous Monk on Aug 03, 2005 at 21:43 UTC
    Thank you so much, that worked