On Saturday, May 18, 2002, at 05:09 , Beau E. Cox wrote:
> use strict; > > my $data = "Received 921MB 16764 3955 375 2.2% 1296 7.7%"; > @_ = $data =~ /\b(\d+)\b/g; > print "$_\n" for (@_); # prints 16764 3955 375 2 2 1296 7 7 > print "$_[2]\n"; # prints your guy: 375 > > Throw the "global" (g) on the RegEx and get the results into an array... In general I am leary of the 'fast cut' - where we use the @_ and $_[$index] tricks - probably because I am concerned about the side effects should we have to handle a signal interrupt in the process.... but so far I have not been able to prove my point in code... so my complements on this! a reasonably elegant solution that avoids the need for temporary variables. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]