http://www.perlmonks.org?node_id=473479


in reply to Re: How do i extract 3 variables from each line in a file, and print them to a new file
in thread How do i extract 3 variables from each line in a file, and print them to a new file

Capturing doesn't work like that. You are overwriting $1 for each match.

Try something like

my @nums = $_ =~ /(\d+)ms/g;
if you want to capture all matches from a /g.

  • Comment on Re^2: How do i extract 3 variables from each line in a file, and print them to a new file
  • Select or Download Code